Tag Info

New answers tagged

0

You can use SDL_LockTexture and SDL_UnlockTexture for write only access to a texture created with the SDL_TEXTUREACCESS_STREAMING flag. Lock, write, unlock, then use SDL_RenderCopy to blit to the screen. Create the buffer with SDL_CreateTexture (modify to you liking): SDL_Texture* buffer = SDL_CreateTexture(renderer, ...


1

Pitch: the length of a row of pixels in bytes Basically, if your texture/surface is 800px wide, and you have 4 bytes per pixel (32bit colour) then the pitch is 800x4 = 3200. Use SDL_QueryTexture() to get texture format, the format can tell you how many bytes per pixel. SDL_QueryTexture(texture, &format, NULL, NULL, NULL); // Parse format with ...


1

Your main character class should not have a reference to the keyboard or any input-related class. Input should be handled in the game loop, or preferably a dedicated input class, decoupled from other entities so they'll only need to respond to abstract actions, not raw input. Not all input is related to your characters and and not all types of input devices ...


0

The problem might not be in SDL. You can try going to your trackpad's settings, look for something called "palm sensitivity" or "palm-something" and reduce it to zero. My trackpad momentarily turned off whenever I pressed a key, because of my PalmCheck settings. I reduced my PalmCheck sensitivity to zero and could freely register key presses and mouse ...



Top 50 recent answers are included