maiden
Member
when i compile and run the following code on a computer, the white rect shows on black background.
but if i compile it on a Wiz / Gp2x / Dingoo, i only gets an black screen, what am i doing wrong?
i have had this problem before, with rects that show up some times and some times not. do i have to lock the screen?
	
	
	
		
				
			but if i compile it on a Wiz / Gp2x / Dingoo, i only gets an black screen, what am i doing wrong?
i have had this problem before, with rects that show up some times and some times not. do i have to lock the screen?
		Code:
	
	#include <SDL/SDL.h>
SDL_Surface* screen = NULL;
int main()
{
  if(SDL_Init(SDL_INIT_EVERYTHING) == -1)
     return 0;
  screen = SDL_SetVideoMode(320, 240, 16, SDL_SWSURFACE | SDL_DOUBLEBUF);
  SDL_Rect rect;
  rect.x = 10;
  rect.y = 10;
  rect.w = 10;
  rect.h = 10;
  SDL_FillRect(screen, &rect, SDL_MapRGB(screen->format,255,255,255));
  SDL_Flip(screen);
  SDL_Delay(2000);
  return 0;
}
	
	