Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I execute the following code, the app can going to finish. but SDL background window is not visible. It is shadow screen only. SDL1.2.15 used.

#include <SDL/SDL.h>
#include <iostream>

using namespace std;

int main(int argc, char* args[])
    SDL_Surface* hello = NULL;
    SDL_Surface* screen = NULL;

    int ret = SDL_Init(SDL_INIT_VIDEO);

    screen = SDL_SetVideoMode(1366, 768, 0, SDL_SWSURFACE);
    if (!screen)
        cout << SDL_GetError() << endl;

    SDL_WM_SetCaption("Window Test", NULL);

    hello = SDL_LoadBMP( "hello.bmp" );
    if (!hello)
        cout << SDL_GetError() << endl;

    SDL_BlitSurface(hello, NULL, screen, NULL);





    return 0;

What's happened? Help!

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.