| Summary: | Screen remains blank after update | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Nicolae Berendea <berendeanicolae> |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED ENDOFLIFE | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | ||
| Version: | 1.2.15 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
|
Description
Nicolae Berendea
2013-07-09 14:12:01 UTC
Is there source code for your app we can see? I'd like to try to reproduce this problem here. --ryan. I have this problem at all the sources I tested (I have to update multiple times to have the screen updated). I've checked again and it seems to work fine the very first time I run the executable, so I am not sure if SDL is the problem.
Here is the source code:
#include <SDL/SDL.h>
#include <cstdio>
int main()
{
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Surface *screen;
if ((screen=SDL_SetVideoMode(800,600,24,0))==NULL)
printf("Error!\n");
if (SDL_FillRect(screen,NULL,0xffffff)<0)
printf("Error!\n");
SDL_UpdateRect(screen,0,0,0,0);
//printf("%d\n",SDL_Flip(screen));
SDL_Flip(screen);
puts(SDL_GetError());
SDL_Delay(3000);
SDL_Quit();
return 0;
}
I tried another window manager (lxde) and I observed that the screen updates right (currently I am using awesome wm). So I returned (to awesome), modified the code and I concluded that awesome wm is the problem because if I add a delay before I update the screen first time, it works well after that. I am sorry for reporting the problem in the wrong place. Anyway, If you need any additional information, ask and I will do my best to respond. I've seen this on Ubuntu under Unity running on VMware as well with SDL 2.0. It's just the first update that doesn't show anything. Subsequent updates work correctly. I'm going to close this for now. Feel free to reopen it if someone has an idea of what's going on. If it's just the first frame, I'm not too concerned, but maybe it's a race with the X server to draw before the window is realized, or something? --ryan. It's not the first frame. It works only after a certain amount of time. That means I have to add a delay or to update 3-4 times (until that time passed). I think that's why it was working when I run the program with valgrind (it runs much slower). So, shortly, you may be right that it's the race thing (I have no idea how it works). Sorry I responded so late. I will respond faster next time. Is there something I can do to avoid using that delay at the begining. Or what do you think is the best way to have a functional program? Just realized this is for SDL 1.2...Sam, did you see this in the 2.0 branch, too? --ryan. I've just tried the sdl2 version. The screen remains black.
#include <SDL2/SDL.h>
int main()
{
SDL_Init(SDL_INIT_VIDEO);
SDL_Window *window;
SDL_Renderer *renderer;
SDL_Rect rect={0,0,100,100};
SDL_CreateWindowAndRenderer(480,360,0,&window,&renderer);
//SDL_Delay(100);
SDL_SetRenderDrawColor(renderer,255,255,255,255);
SDL_RenderFillRect(renderer,&rect);
SDL_RenderPresent(renderer);
SDL_UpdateWindowSurface(window);
SDL_Delay(1000);
SDL_Quit();
return 0;
}
Yes, I saw this with SDL 2.0. I think it's an X11 regression. Hello, and sorry if you're getting several copies of this message by email, since we are closing many bugs at once here. We have decided to mark all SDL 1.2-related bugs as RESOLVED ENDOFLIFE, as we don't intend to work on SDL 1.2 any further, but didn't want to mark a large quantity of bugs as RESOLVED WONTFIX, to clearly show what was left unattended to and make it easily searchable. Our current focus is on SDL 2.0. If you are still having problems with an ENDOFLIFE bug, your absolute best option is to move your program to SDL2, as it will likely fix the problem by default, and give you access to modern platforms and tons of super-cool new features. Failing that, we _will_ accept small patches to fix these issues, and put them in revision control, although we do not intend to do any further official 1.2 releases. Failing that, please feel free to contact me directly by email (icculus@icculus.org) and we'll try to find some way to help you out of your situation. Thank you, --ryan. |