Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: SDL

  1. #11

    SDL

    Many thanks for your help

    OK I've found it and the TimerTest project, but I can't compile it :cry:

    This is from TimerTest:
    [pascal]
    Timer1 := SDL_AddTimer(500, CallTimer1, @Param1);
    [/pascal]

    gives me this error:

    [Error] Main.pas(86): Incompatible types: 'TSDL_TimerID' and 'PSDL_TimerID'

    Timer1 is a PSDL_TimerID but the function returns a TSDL_TimerID.

    Am I doing something wrong here? :roll:

  2. #12

    SDL

    Quote Originally Posted by BlueCat
    gives me this error:

    [Error] Main.pas(86): Incompatible types: 'TSDL_TimerID' and 'PSDL_TimerID'

    Timer1 is a PSDL_TimerID but the function returns a TSDL_TimerID.

    Am I doing something wrong here? :roll:
    In my version of SDL.pas SDL_AddTimer is defined as

    [pascal]function SDL_AddTimer(interval: UInt32; callback: TSDL_NewTimerCallback; param
    : Pointer): PSDL_TimerID; cdecl; external LibName;[/pascal]

    Where did you grab your JEDI-SDL distribution?

    If you have the time, I would recommend grabbing the latest of everything from CVS. If you need help gettting started, just yell.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  3. #13

    SDL

    Savage you are sooooo helpful, got the *cough* correct *ahem* version of SDL.pas and it worked first time.

    Just goes to show, check you have the latest stuff or you end up wasting several hours trying to make it work :roll: :roll: :roll: :roll:

    Thanks for all your help.

    I'll get the demo ready now and you'll be able to see the timer in action :lol: :lol: :lol: :lol:

  4. #14

    SDL

    Quote Originally Posted by BlueCat
    Quote Originally Posted by savage
    Glad to hear you have found it usefull.

    Any chance of seeing a demo on Windows or Linux?
    Yes, I'm planning on using SDL from now to develop my game and I'll upload a new demo in a couple of days to the usual address (the url for dgdev without the dgdev bit ).

    I've had trouble with window resizing. Unfortunately my engine uses lots of display lists. I use SDL_SetVideoMode to resize the window (or switch to fullscreen) but in the process the OpenGL context is destroyed and a new one created. The problem is, this also destroys my display lists (which reside in an octree). It takes 20 seconds or so on my 1.2GHz machine to recreate the display lists, much longer on slower machines.

    Does anyone know how I can change video modes without destroying the OpenGL context? I know that might be impossible, so if not any other tricks? :twisted: :twisted: :twisted:
    I posted your question on the main SDL mailing list and this is the response I got from a guy called Glenn Maynard...
    "
    I wrote a hack for the Windows implementation to allow changing some
    window settings (everything except bit depth, I believe, which needs a
    new context anyway), but only in Windows; I haven't implemented it on
    anything else yet.

    I'll attach it. It moves some stuff, so it's a little large. The code
    to use it looks like this:

    #ifndef SDL_HAS_CHANGEVIDEOMODE
    /* We can't change the video mode without nuking the GL context. */
    need_reload = true;
    #endif

    if( bpp != g_CurrentBPP )
    need_reload = true; /* can't do this with SDL_SM_ChangeVideoMode_OpenGL */

    if(need_reload) {
    if(TEXTUREMAN) TEXTUREMAN->InvalidateTextures();
    }

    if(!g_screen || need_reload) {
    g_screen = SDL_SetVideoMode(width, height, bpp, g_flags);
    if(!g_screen)
    throw RageException("SDL_SetVideoMode failed: %s", SDL_GetError());

    SDL_WM_SetCaption("StepMania", "StepMania");
    }
    #ifdef SDL_HAS_CHANGEVIDEOMODE
    else
    {
    SDL_SM_ChangeVideoMode_OpenGL(g_flags, g_screen, width, height);
    }
    #endif

    You'll need to massage the patch (remove the refresh rate stuff, add a
    prototype and the SDL_HAS_CHANGEVIDEOMODE #define) if you want to use it.
    (Sorry, I didn't clean it up because diffing is a bit of a pain for me at
    the moment ...)

    I think this is something the SDL really needs to handle; nuking the GL
    context to change video settings is definitely not good. I'm not sure of
    a good general-purpose way to handle it, though, considering that some
    archs may not be able to do certain things without a context recreation.

    -- Glenn Maynard"

    Sorry that it is C code, but I hope it proves useful

    BTW you can join the main JEDI-SDL mailing list @
    http://groups.yahoo.com/group/JEDI-SDL/join
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  5. #15

    SDL

    That might help I'll look into it, thanks for asking the question on the mailing list.

    I've uploaded a demo, it's version 0.05 on the downloads page at http://terraqueous.f2o.org.

    I have a feeling I've forgotten to include something crucial in the zip file

    If someone could test it for me I'd be grateful.

Page 2 of 2 FirstFirst 12

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
  •