Results 1 to 2 of 2

Thread: ClanLib crashes when creating CL_DisplayWindow with target SDL.

  1. #1
    Squire Otto (Strange) Halmén's Avatar
    Join Date
    Sep 2006
    Location
    A city called Loviisa, in southern Finland, Europe.
    Posts
    20

    Default ClanLib crashes when creating CL_DisplayWindow with target SDL.

    The OpenGL target works fine, but I get...
    GDB: Program received signal: "SIGTRAP".
    ...and this error thread when creating a display window using SDL as a target:
    Code:
    #include <ClanLib/core.h>
    #include <ClanLib/application.h>
    #include <ClanLib/display.h>
    #include <ClanLib/sdl.h>
    
    #include "graphics.h"
    
    class MyApp : public CL_ClanApplication
    {
    public:
    	virtual int main(int argc, char **argv)
    	{
    		CL_ConsoleWindow console("Console");
    		console.redirect_stdio();
    		
    		try
    		{
    			CL_SetupCore setup_core;
    			CL_SetupDisplay setup_display;
    			CL_SetupSDL setup_gl;
    
    			CL_DisplayWindow window("Gesamtschule", 512, 384);
    			...
    And the thread continues from the CL_DisplayWindow constructor:
    Code:
    CL_DisplayWindow::CL_DisplayWindow(...)
    	...
    	impl->create_window(desc);
    	...
    And the thread goes on:
    Code:
    void CL_DisplayWindow_SDL::create_window(...)
    {
    	...
    	if((screen = SDL_SetVideoMode(desc.get_size().width,desc.get_size().height,desc.get_bpp(),mode)) == NULL)
    	...
    And then, Xcode doesn't show more of the thread, only this message:
    GDB: Error: Xcode could not locate source file: SDL_video.c (line: 659)
    A quick Spotlight search reveals that only a SDL_video.h file exists, but no SDL_video.c is found. However, the thread goes on, although I am unable to see the content. Here is the whole thread at one glance:
    #0 0x92978120 in _NSRaiseError
    #1 0x93741d60 in -[NSWindow _commonAwake]
    #2 0x93731624 in -[NSWindow _commonInitFrame:styleMask:backing:defer:]
    #3 0x93730948 in -[NSWindow _initContent:styleMask:backing:defer:contentView:]
    #4 0x93730730 in -[NSWindow initWithContentRect:styleMask:backing:defer:]
    #5 0x30061534 in -[SDL_QuartzWindow initWithContentRect:styleMask:backing:defer:] at SDL_QuartzWindow.m:196
    #6 0x3005e3dc in QZ_SetVideoWindowed at SDL_QuartzVideo.m:742
    #7 0x3005ed68 in QZ_SetVideoMode at SDL_QuartzVideo.m:850
    #8 0x30047510 in SDL_SetVideoMode at SDL_video.c:659
    #9 0x00206c90 in CL_DisplayWindow_SDL::create_window at display_window_sdl.cpp:143
    #10 0x01670014 in CL_DisplayWindow::CL_DisplayWindow at display_window.cpp:65
    #11 0x007b6720 in MyApp::main at main.cpp:26
    #12 0x0001b9a8 in main at clanapp.cpp:59
    Does anybody have any idea what causes this error and how to avoid it?

    EDIT: I recently noticed that the program runs a little further with full screen enabled; It initializes correctly and draws one single frame, then freezes. The frame loses some of the detail "not implemented yet" in the SDL target, but there is no color warp unlike in the OpenGL target.
    Last edited by Otto (Strange) Halmén; 12-09-2006 at 02:41 PM.
    In Finnish, "Strange" is spelled "Outo" which is very similar to my real first name, but that's not the main reason why my friends chose to call me that...

    No homepage yet, but when my raycaster becomes good enough to be released, I'll make one.

  2. #2

    Default

    To anyone who comes across this thread, I have a potential work around.

    I was creating a new window with CL_DisplayWindow window("title", 1024, 768, true); with the SDL target. This starts and runs okay, but it segfaults when the program exits. However, calling window.set_windowed(); before calling CL_SetupSDL::deinit(); changes the display to a window before exiting, and without a segfault.

    So...

    CL_SetupSDL::init();
    CL_DisplayWindow window("title", 1024, 768, true);
    // Call the main game loop here
    window.set_windowed();
    CL_SetupSDL::deinit();

    Executes correctly (for me, Ubuntu 7.10 + ClanLib 0.8).

Similar Threads

  1. Video in ClanLib
    By d_oilen in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 06-04-2007, 02:52 PM
  2. Creating add-ons for games and NovaShell?
    By whisperstorm in forum Novashell Game Creation System
    Replies: 2
    Last Post: 11-28-2006, 12:45 AM
  3. Dink editor loads then crashes.
    By CMDR Reservoir in forum Dink Smallwood HD
    Replies: 3
    Last Post: 12-23-2004, 08:43 AM
  4. Flash errors/crashes
    By Mugombie in forum Funeral Quest
    Replies: 1
    Last Post: 06-15-2004, 03:44 AM
  5. Creating TGA files...
    By Akolade in forum RTsoft Tavern
    Replies: 3
    Last Post: 02-20-2003, 04:31 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •