Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Radek

Pages: [1]
1
General / Re: push/resetGLStates and buffers
« on: October 31, 2017, 04:59:01 am »
Quote
I found no answer on the internet or these forums
This is surprising, because it is a recurring problem.

its largely because I didn't know what the problem was until I actually solved it.

The only keywords I could use involved things such as sprites not drawing. Once I found the problem I should have searched, but I didn't, that was another my bad moment.

As for the other suggestion, I plan to drop the graphics module, but the current project has a time crunch to it so I don't have the time to manage basic but useful functions that the Sprite object has, so I may as well use that for now, and simplify the draw code to what you have built in to SFML.

Anyway, thanks for the help, sorry for repeating a question/problem that has been looked at before.
However while I am here, are you unable to make resetGLStates reset the buffer states because SFML itself still uses old OpenGL? After all, the fix was to simply call
glBindBuffer(GL_ARRAY_BUFFER, 0);

2
General / push/resetGLStates and buffers
« on: October 27, 2017, 02:14:27 am »
I had a problem up until recently involving the mixing of OpenGL draw calls and SFML draw calls.

I'm focusing on using OpenGL itself and simply having SFML handle input, OpenGL contexts, Mutex, and a few simple sprites.

While implementing my more advanced model loading/displaying, some sprites within the program stopped drawing (pause menu sprites for the game), it was nothing major and I ignored it until my next bug sweep.

Anyway, I found no answer on the internet or these forums from my searching, but I eventually worked it out.

I am unsure if its a bug, not a feature yet, or something that push/resetGLStates will not handle, but it did not reset the GL_VERTEX_BUFFER I was using for my models. It was in the end my fault, as I should have been resetting the buffer after using it, but I'm an idiot sometimes.

I thought I'd share the results here in case someone else has the same issue, or if the development team would consider implementing resetting the vertex buffer when calling push/resetGLStates because it interferes with SFML draw calls if a buffer is currently set.

Pages: [1]