jfcameron / gdk-graphics

3D Rendering using OpenGLES 2.0/WebGL1.0. Platforms: Linux, Windows, Mac, x86 64bit, arm64, wasm
MIT License
1 stars 1 forks source link

glh header: add smart_handle wrappers for buffer creation functions #41

Closed jfcameron closed 3 years ago

jfcameron commented 3 years ago

while writing texture_camera, wrote redundant init code for textures. negotiating valid handles to buffers (texture buffer objects, vertex buffer objects, frame buffer objects, ....) should be moved to the helper to prevent duplication

jfcameron commented 3 years ago

webgl1es2_texture.cpp is full of useful (but static) functions all around keeping the context in a valid state when interacting with the texture related glfunctions. I wanted to keep all this in texture's cpp file to keep it easy to read but because texture_camera needs access to this code, it needs to be moved to a shared location. glh.h makes some sense, but if I do that then I should also move a lot of other low level code (shader.cpp comes to mind, even though that code does NOT need to be accessible outside of its compilation unit). maybe splitting glh to be more specific makes sense. need to think about this

jfcameron commented 3 years ago

overall I want to keep code as local as possible. It turns out I didnt have to directly use opengl's texture functions, i used the texture class I made, much better solution.