0
votes
1answer
21 views

SDL render to a texture

I am trying to create a button for my game there are lots of similar buttons so using an image for each one is a bit inefficient. So I want to load an image then copy some text over it and render that ...
0
votes
1answer
69 views

Which buffering process would be more efficient?

I'm working on the base engine of my game right now, specifically converting a text file into a level on-screen. As a 2D platformer, each level has an array of rectangles that can be drawn to the ...
0
votes
1answer
36 views

Text not being rendered until I recreate the text class in SDL

I made a Text class, it is as shown below: Text::Text(const int score, const float &x, const float &y, const float &w, const float &h, SDL_Renderer *rend) { font = ...
1
vote
4answers
2k views

Rendering multiline text with SDL_TTF

Can you use any function to render more than a line of text in a surface? If you can't do this, what whould be the way to go? I am doing the following: Create a surface (not sure if should be a ...
1
vote
2answers
245 views

How do I cap rendering of tiles in a 2D game with SDL?

I have some boilerplate code working, I basically have a tile based map composed of just 3 colors, and some walls and render with SDL. The tiles are in a bmp file, but each tile inside it corresponds ...
1
vote
1answer
449 views

Lost transparency in SDL surfaces drawn manually

I want to create SDL_Surface objects for each layer of my 2d tile-based map so that I have to render only one surface per layer rather than too many tiles. With normal tiles which do not have ...
4
votes
1answer
438 views

How to use caching to increase render performance?

First of all I am going to cover the basic design of my 2d tile-based engine written with SDL in C++, then I will point out what I am up to and where I need some hints. Concept of my engine My ...
-1
votes
2answers
297 views

FreeType2 Crash on FT_Init_FreeType

I'm currently trying to learn how to use the FreeType2 library for drawing fonts with OpenGL. However, when I start the program it immediately crashes with the following error: "(Can't correctly start ...
0
votes
1answer
625 views

SDL and software/hardware rendering. How to go about it?

I know that SDL 1.2 does software rendering (CPU) and not hardware rendering (GPU). My question is, how do I use SDL but with hardware rendering? How do I not use its rendering API (software) and ...
0
votes
1answer
832 views

Will using OpenGL for rendering with SDL make my 2D game run smoother?

I've been working on a 2D game using SDL. I've noticed the objects look blurry and glitchy when they're moving, so I was thinking about using OpenGL to render the graphics. Would this help? What ...