Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SDL_WM_SetCaption not working

Tags:

c++

sdl

any idea why the following code isn't working? Nothing happens when it's called, the window title is still untitled. I'm on Ubuntu linux.

SDL_Init( SDL_INIT_VIDEO );
    SDL_WM_SetCaption("Window Title", "Icon Title");
    SDL_Surface* screen =  SDL_SetVideoMode( 512, 512, 32, SDL_HWSURFACE | SDL_DOUBLEBUF );
    Vector2 center =  Vector2(256,256);
    const char* c =  "test";
    SDL_WM_SetCaption( c, 0 );
    SDL_Event event;
like image 263
Precursor Avatar asked Mar 05 '26 17:03

Precursor


1 Answers

Make your first call to SDL_WM_SetCaption after SDL_SetVideoMode has been called. Also, remove the second test call. If you are using SDL 1.3, (it sounds like you are using 1.2, so you can probably ignore this), call SDL_SetWindowTitle:

like image 200
Darcy Rayner Avatar answered Mar 07 '26 07:03

Darcy Rayner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!