Re: [tsc-devel] Re: SFML Port New Strategy...

Quintus | Sat, 07 Nov 2015 12:35:27 UTC

datahead <…r@f…> writes:

> Post via forum by datahead <…9@x…>:
> eXpl0it3r pointed out that the OpenGL and SDL Rendering Code (if there
> is SDL rendering code at all) probably must be ported together as one
> unit.

I took a look at the current OpenGL/SDL rendering implementation in
core/main.cpp and video/video.cpp. Well. I think there is not much else
possible than wiping both files, since they contain a lot of
OpenGL- and SDL-specific code. Trying to preserve the API of pVideo is
going to destroy the well thought-out API of SFML. Trying to shoehorn it
into the existing pVideo API might prove rather complicated. I would
appreciate it if someone else could look at those files and post how
they think about this.

This[1] for example is unportable and will need to be removed, and all
the code that corresponds with the BPP, which is a lot in that
method. What do these[2] lines do? Something with OpenGL supposedly, but
SFML has its own instructions on how to combine it with
OpenGL[3]. cVideo::Init_Video() is a terrible method by the way, it is
much, much to long and makes it impossible to get an overview of what it
actually does. cVideo::Init_OpenGL()[4] seems to be superflous with SFML
also, and likewise all the other Init_* methods, aren’t they? How is
Test_Video() supposed to work with SFML[5]? Make_GL_Context_Current() and
Make_GL_Context_Inactive()[6] are going to interfer with SFML’s own
managing most likely. Then there are render requests[7]; something I can
make neither head nor tail of. I can’t think of any way to incorpate
this with SFML, but grepping through the code it seems they are used at
several places.

There are many more examples like this; they are so tailored towards raw
OpenGL and some of SDL’s API design specifics that maintaining the
cVideo API with SFML will take a lot of work, and video.cpp needs to be
rewritten from scratch during that course anyway. It seems that OpenGL
works by some global state of the program somehow, which appears to me
like broken design and is totally incompatible with SFML’s
object-oriented API. cVideo makes a shot at trying to wrap OpenGL’s API
into something usable, but unfortunately, SFML does this as well, and it
does it fairly differently.

Given this I will likely not be of much help in trying to maintain the
current API. It appears to me that just redoing it from scratch is
easier than trying to keep existing stuff around as far as
possible. Feel free to argue differently, but please familiarise
yourself with how rendering is done currently in OpenGL/SDL TSC before
doing so. core/main.cpp and video/video.cpp are the files you need to
look at for this.

Valete,
Quintus

[1]: https://github.com/Secretchronicles/TSC/blob/devel/tsc/src/video/video.cpp#L278-L309
[2]: https://github.com/Secretchronicles/TSC/blob/devel/tsc/src/video/video.cpp#L401-L405
[3]: http://www.sfml-dev.org/tutorials/2.3/window-opengl.php
[4]: https://github.com/Secretchronicles/TSC/blob/devel/tsc/src/video/video.cpp#L491-L543
[5]: https://github.com/Secretchronicles/TSC/blob/devel/tsc/src/video/video.cpp#L793-L806
[6]: https://github.com/Secretchronicles/TSC/blob/devel/tsc/src/video/video.cpp#L847-L878
[7]: https://github.com/Secretchronicles/TSC/blob/devel/tsc/src/video/renderer.hpp

-- 
#!/sbin/quintus
Blog: http://www.guelkerdev.de

GnuPG key: F1D8799FBCC8BC4F

By Thread
2015-11-05 21:24:48datahead[tsc-devel] SFML Port New Strategy...
2015-11-05 21:43:01Lauri OjansivuRe: [tsc-devel] SFML Port New Strategy...
2015-11-05 21:49:22datahead[tsc-devel] Re: SFML Port New Strategy...
2015-11-05 21:57:11Lauri OjansivuRe: [tsc-devel] Re: SFML Port New Strategy...
2015-11-06 09:41:01QuintusRe: [tsc-devel] Re: SFML Port New Strategy...
2015-11-06 18:11:57datahead[tsc-devel] Re: SFML Port New Strategy...
2015-11-07 12:35:27QuintusRe: [tsc-devel] Re: SFML Port New Strategy...
2015-11-22 21:13:21QuintusRe: [tsc-devel] SFML Port New Strategy...
2015-11-24 05:27:15datahead[tsc-devel] Re: SFML Port New Strategy...
2015-11-24 09:28:33QuintusRe: [tsc-devel] Re: SFML Port New Strategy...
By Date
[tsc-devel] SFML Port New Strategy...datahead2015-11-05 21:24:48
Re: [tsc-devel] SFML Port New Strategy...Lauri Ojansivu2015-11-05 21:43:01
[tsc-devel] Re: SFML Port New Strategy...datahead2015-11-05 21:49:22
Re: [tsc-devel] Re: SFML Port New Strategy...Lauri Ojansivu2015-11-05 21:57:11
Re: [tsc-devel] Re: SFML Port New Strategy...Quintus2015-11-06 09:41:01
[tsc-devel] Re: SFML Port New Strategy...datahead2015-11-06 18:11:57
Re: [tsc-devel] Re: SFML Port New Strategy...Quintus2015-11-07 12:35:27
Re: [tsc-devel] SFML Port New Strategy...Quintus2015-11-22 21:13:21
[tsc-devel] Re: SFML Port New Strategy...datahead2015-11-24 05:27:15
Re: [tsc-devel] Re: SFML Port New Strategy...Quintus2015-11-24 09:28:33