Skip to content

Decouple GL from ofGraphics - #8554

Open
NickHardeman wants to merge 9 commits into
openframeworks:masterfrom
NickHardeman:decouple-gl-1
Open

Decouple GL from ofGraphics#8554
NickHardeman wants to merge 9 commits into
openframeworks:masterfrom
NickHardeman:decouple-gl-1

Conversation

@NickHardeman

Copy link
Copy Markdown
Contributor

Removed GL specific code in ofGraphics and required the following definitions in renderers.

void drawBackgroundGradient(const ofFloatColor& start, const ofFloatColor& end, ofGradientMode mode) const;
void enablePointSprites();
void disablePointSprites();

Removed ofVboMesh from ofPath and replaced with ofMesh.
This makes it a bit easier to create new renderers without having certain functions and variables tied to GL specific code.

@ofTheo

ofTheo commented Sep 4, 2026

Copy link
Copy Markdown
Member

Awesome!
And I think we could do some more to consolidate, where the GL functions get abstracted out of drawBackgroundGradient so the mesh generation etc for the backgroundGradient could be universal and in one place.
But this is great for the timebeing!!

Nice to see some steps towards real swappable renderers

@NickHardeman

Copy link
Copy Markdown
Contributor Author

@ofTheo agree, it's not great that the code is duplicated between the GLRenderer and the programmable renderer.
Renderers like ofCairoRenderer don't support mesh colors
ofLogWarning("ofCairoRenderer") << "draw(): cairo mesh rendering doesn't support colors, textures, or normals. drawing wireframe ...";

And ofNoopRenderer doesn't draw anything :)

class ofNoopRenderer: public ofBaseRenderer{

@danoli3

danoli3 commented Sep 5, 2026

Copy link
Copy Markdown
Member

Very nice!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants