Confusing problem with fields vs local variables and rendering (OpenGL) #2244
Unanswered
TheToblexson
asked this question in
Q&A
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to learn/implement OpenGL and I've got a rendering framework functioning. I can add a shape to the render list from my Layer update method, and I can add a shape from a collection from within that update method, but if I try to add a shape from a class field it is not rendered.
My guess is that this has something to do with addresses/pointers, and OpenGL not getting the array that Visual Studio is telling me it is, but I don't have a perfect understanding of OpenGL or rendering in general, so I could be completely wrong, and either way, I don't know how to further troubleshoot it. I'm definitely sharing some excess code, but I don't want to cut any methods from these files in case they actually do end up being the cause. The phantom types (like RenderQuad) are mostly just helper structs or struct-like classes and really shouldn't be causing this problem.
I also doubt that my method of subbuffering is efficient, but I thought it was at least working until now.
Sorry if this is the wrong place to ask, or if I've formatted this question attrociously.
I've removed a lot of comments, summary tags and regions to streamline the pasted code, so there might be some random half comments or half regions that I missed.
Update: It isn't lists that are causing the problem, rather fields vs locally defined variables. If I define a button in the Update method, then it renders. However, if the same variable is instead a class field it is not rendered, apart from a split second flash that might be the very first render call. I really have no clue here.
Layer Class
Renderer Class
Application Class
Beta Was this translation helpful? Give feedback.
All reactions