Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17625

exception in sdl2_ttf.lib

$
0
0

when I am trying to render multi lines of text I get this exception ("Exception thrown at 0x00000000710020BA (SDL2_ttf.dll) in Project16-test record.exe: 0xC0000005: Access violation reading location 0x0000000000000008. occurred")

and this is my code:

#include "Ltext.h"

 

TTF_Font *gFont = TTF_OpenFont("carson.ttf", 24);

SDL_Color gTextColor = { 0, 0, 0, 0xFF };

 

Ltext::Ltext()

{

texy = 0;

texw = 0;

texh = 0;

mTexture = NULL;

textSurface = NULL;

gRecordingDeviceCount = 0;

}

 

 

Ltext::~Ltext()

{

}

 

void Ltext::loadtext(const char* text, SDL_Color textColor,SDL_Renderer* gren)

{

free();

SDL_SetRenderDrawColor(gren, 255, 255, 255, 255);

SDL_RenderClear(mrender);

//Render text surface

textSurface = TTF_RenderText_Solid(gFont, text, textColor);

if …


Viewing all articles
Browse latest Browse all 17625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>