Repository navigation
Non GL Renderers #8611
NickHardeman
started this conversation in
Ideas
Replies: 1 comment
Yeah!! I think this choice is the big one to figure out. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
GL based classes like
ofTexturehave become integrated into the OF core. Since it is GL based, implementing non-GL based renderers proves difficult. Especially for commonly used classes likeofTrueTypeFont,ofVideoPlayer,ofVideoGrabber, etc. that rely on ofTexture.Adopting a BaseClass, implementation structure similar to
ofVideoGrabberorofAppBaseWindowwould allow for class abstraction and access to the underlying backend texture type. The current public class keeps its existing signature. Possibly deprecating very specific GL functions to begin phasing them out.For example.
Should the texture types be set by a define or by the renderer that is created by the window? Defines would make it clear what is used and may allow for faster compiles. Texture type by the renderer would allow for a bit more flexibility.
GL specific calls could be abstracted, similar to the current ofTexCompression enum.
For backwards compatibility, functions that take in GL specific arguments like GL_RGB, GL_RGBA, etc. could have an enum that maps to their GL counterparts. Some defines may be necessary for ES specific or missing types.
So functions like allocate() would not break in existing projects.
void allocate(int w, int h, int glInternalFormat, bool bUseARBExtension);And would also have an enum counterpart
void allocate(int w, int h, ofTextureFormat fmt, bool bUseARB);Advanced use cases where
ofTextureDatais accessed and set by users directly proves a bit more difficult.Other GL based classes could adopt the same approach,
ofFbo,ofShader,ofVbo,ofBufferObject,ofCubeMap,ofShadow, etc.The goal being to transition away from GL dependent code while also supporting as many current code bases as possible.
Curious what the community thinks about approaches that allow for the inclusion of non-GL renderers.
All reactions