[SDL] Confusing display problem
Josh Matthews
mrlachatte at gmail.com
Sat Jun 3 22:09:08 PDT 2006
You're probably not using the same surface types. Make sure you do
something like
SDL_Surface *temp = SDL_DisplaySurface(window);
SDL_FreeSurface(window);
window = temp;
before doing anything to the window surface.
On 6/4/06, Tyler Mandry <tmandry at gmail.com> wrote:
>
> Hi, I'm Tyler Mandry, and I'm making a C++ game called (for now)
> Adage. I've coded the beginnings of a basic widget set for it, and
> have a well-structured system of Widgets and (virtual) Windows that
> handle the widgets, and finally a WindowManager that handles the
> Windows. Windows aren't really, well, windows (at least not according
> to the OS/WM); the whole game is in one actual window and the Windows
> are just classes that blit onto there.
>
> I've run into a big problem, though: I can't get any widgets to
> display anymore, except for a simple Text widget (front end to
> sdl-ttf). The widgets seem to blit onto their parent surface
> successfully, which is a Window class. I've tested this - when setting
> the Widget's parent surface to the main window surface, it works, and
> when creating the Window's surface using SDL_CreateRGBSurfaceFrom()
> with the main surface (which shares the pixel data between surfaces),
> it works. When using this technique, however, the color on the widgets
> is wrong, UNLESS the Window blits its surface back onto the main
> surface. It's just weird that the blit actually has an effect, and yet
> doesn't seem to be working.
>
> The widgets worked before I started using the Window system (and had
> widgets blitting directly to the screen). I made some other changes at
> the same time; there's a small chance that they could have had an
> affect. My friends and I have gone over the code for hours, and I've
> finally concluded that it has to be a problem with my usage of SDL (or
> SDL itself, which is unlikely). I'm using SDL 1.2.8.
>
> I need help! I just don't know what's wrong. So, if you have any
> ideas, please tell me, and if you have any questions please ask. I
> hope I wasn't too confusing. Thank you VERY MUCH in advance!
>
> If you want access to the sources, you can check them out via SVN
> (make sure to get rev. 50):
>
> $ svn co -r 50 http://peltkore.net/svn/adage
>
> or view them in WebSVN:
> http://peltkore.net/websvn/listing.php?repname=adage&path=%2F&rev=50
>
> If you want, you can also take a look at revisions 51 and 52 for
> examples of what happens when we try the (hackish) things I talked
> about. 51 displays correctly but the code is all twisted. To build
> them (on linux), cd into trunk/src and just do `make` and try running
> both `./main` and `./preview` (both are pretty much just widget tests
> for now).
>
> Thanks again,
> --
> Tyler Mandry
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>
--
Cheers,
Josh
PGP: http://revvy.box43.net/Josh_Matthews.asc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060604/6401e420/attachment.html
More information about the SDL
mailing list