Tag Info

New answers tagged

2

It's pretty straightforward, if not entirely well documented. Reading the source (not sure if the released version differs significantly) tells me that you must export an environment variable SDL_DYNAMIC_API with the name of the .so you want to load. That .so must contain a symbol SDL_DYNAPI_entry with signature: Sint32(SDLCALL*)(Uint32 apiver, void *table, ...


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 = ...



Top 50 recent answers are included