Tag Info

New answers tagged

0

I know its kind of old question but I see you got no answers and maybe its still relevant... why do you want to use additive blending instead of modulate blending (SDL_BLENDMODE_MOD)? with modulate the output is dstRGB = srcRGB * dstRGB, so you can make your lit areas brighter (while white is maximum lit) and dark areas are the shade. if I understood you ...


2

This indeed should be very simple, so I suspect you may have gotten some details wrong. The overall goal is to match up the center of the camera with the midpoint of the players. As you've found though, those values aren't immediately available to you, so you need to work them out. What you might have are (leaving out the Y axis stuff since we don't need ...


0

You can't just generate the points in a grid and hope OpenGL figures our what you want. When you use glDrawArrays you need to pass the whole triangles (or whatever primitive you're drawing) to it. So either change your loop to: for( int y=0;y<height-1;y++ ) { for( int x=0;x<width-1;x++ ) { vertices.push_back( glm::vec3( y,heightMap[x][y],x ...


0

If you have uncapped FPS, it should eat 100% of your CPU, but most probably you want cap FPS at some reasonable value, say 60 fps, basic implementation can be as follows: const unsigned int FPS = 60; const unsigned int DELAY_TIME = 1000 / FPS; unsigned int frameStart, frameTime; int spareTime; // your main loop while (bRunning) { frameStart = ...


2

SDL2 doesn't need any functionality to be added for either of those items. Texture batching You yourself can sort the sprites by texture used. The SDL backends can already do draw call batching if they wish to (nothing requires that the Copy command be executed immediately; the only requirement is that it be executed by the time any side effects are ...


1

The issue was in using GL_DOUBLE for the vertices. Changing to GL_FLOAT seems to have done the trick. You need to use glVertexAttribLPointer when using double. EDIT That is not completely accurate. glVertexAttribLPointer (...) is for double and dvecN vertex attributes, which your shader is not using. To use glVertexAttribLPointer meaningfully would ...


1

Better later than never answer:SDL is still blind to this, even though, it was promised to be implemented in v1.3 -after Windows XP came out with supporting multiple keyboard/mice-.FYI when I write this we are at SDL 2.0.3. Found only some puffing comments that say "SDL will not support this!". It's a shame as (e.g.) openFL uses SDL too (in Haxe lang).The ...



Top 50 recent answers are included