Results 1 to 10 of 10

Thread: SDL GL vs. dglOpenGL

  1. #1

    SDL GL vs. dglOpenGL

    If i call:

    Code:
    procedure TF3D_TextureFactory.BindTextureToLayer(id: integer; target: integer);
    begin
    
        glActiveTextureARB(GL_TEXTURE0 + target);
        glEnable(GL_TEXTURE_2D);
        glBindTexture(texture_list[id].GLtarget, texture_list[id].Texture);
    
    end;
    with SDL OpenGL, program crash, but with dglOpenGL and no SDL work cool. What is problem?
    C2D X6800, 4GBRAM, NV8800GTX, Vista x64 Ultimate

  2. #2

    SDL GL vs. dglOpenGL

    Are you sure that you did a complete rebuild for your project? I use both SDL GL and dglOpenGL and sometimes I forget to do a complete rebuild when switching between these two and get some nasty crashes.
    If you develop an idiot proof system, the nature develops better idiots.

  3. #3

    SDL GL vs. dglOpenGL

    Actualy i use only SDL opengl like gl,glu,glext from JEDI-SDL, and i always clean compiler data. I use CodeGear Win32 on Vista x64.

    Other stange thing is i.e. if i call

    glGetIntegerv(GL_MAX_TEXTURE_UNITS, @MAX_TEXTURE_UNITS);

    result is 0.
    C2D X6800, 4GBRAM, NV8800GTX, Vista x64 Ultimate

  4. #4

    SDL GL vs. dglOpenGL

    I had that exact problem with SDL and dglOpenGL when i wanted to use some of the extensions, i know use SDL with dglOpenGL and it seems to work fine.

    Im not sure why but when ever i used the GL units that come with SDL, none of the extensions get loaded, not sure if you need to load them seperatly or not.

    If your intrested i can give you the source to my engine screen?
    M109uk
    <br />--------------------------------------------------------
    <br />www.pulse-soft.oneuk.com

  5. #5

    SDL GL vs. dglOpenGL

    Indeed, you have to manually load all extensions if you use the SDL GL headers, dglOpenGL does this automatically.

    [pascal]
    const
    MAX_EXTENSION = 1;
    Extensions: array [0..MAX_EXTENSION] of String = (
    'GL_ARB_multitexture',
    'xxx'
    );


    for i := 0 to MAX_EXTENSION do
    if glext_ExtensionSupported(PChar(Extensions[i]), #0) then
    glext_LoadExtension(Extensions[i])
    else
    s := Extensions[i] + #13#10;
    if s <> '' then
    raise EOpenGLError('All needed OpenGL extensions are not supported! Unsupported extensions: ' + #13#10 + s);
    [/pascal]

    That's what I seem to have in my OpenGL initialization when using SDL.
    If you develop an idiot proof system, the nature develops better idiots.

  6. #6

    SDL GL vs. dglOpenGL

    Exist any function for automatic load all possible extensions? Because write now LIST OF ALL EXT are crazy for me.
    C2D X6800, 4GBRAM, NV8800GTX, Vista x64 Ultimate

  7. #7

    SDL GL vs. dglOpenGL

    Maybe if you load extensions GL_version_1_4, GL_version_1_5, GL_version_2_0 and so on, in theory those should include everything?
    If you develop an idiot proof system, the nature develops better idiots.

  8. #8

    SDL GL vs. dglOpenGL

    Quote Originally Posted by vgo
    Maybe if you load extensions GL_version_1_4, GL_version_1_5, GL_version_2_0 and so on, in theory those should include everything?
    Yes. I tried this, but don't work for all EXT.

    I have sollution:

    create GL_EXT.list file as stringlist like this:


    glext.Load_GL_ARB_multitexture();
    glext.Load_GL_version_1_2();
    glext.Load_GL_version_1_3();
    glext.Load_GL_version_1_4();
    glext.Load_GL_version_1_5();
    glext.Load_GL_version_2_0();

    ...

    an then after SDL init i include it via:

    {$I GL_EXT.list}


    Now i tested and work cool Will be implemented in my engine ver. 0.05.
    C2D X6800, 4GBRAM, NV8800GTX, Vista x64 Ultimate

  9. #9

    SDL GL vs. dglOpenGL

    You just need to call

    Load_GL_Version_x_x

    after creating the SDL window.

    Don't forget to also call

    [pascal]
    SDL_GL_SetAttribute(SDL_GL_RED_SIZE, ;
    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, ;
    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, ;
    SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, ;
    SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, 32); // 24 or 32 bit buffer
    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); // 24 bit z buffer
    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
    if createStencilBuffer then
    SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, ; // 8 bit stencil buffer
    [/pascal]

    BEFORE you call SDL_SetVideoMode to setup opengl correctly. look at
    http://www.cerebral-bicycle.co.uk/vi...doc=307&date=Y for more info.
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  10. #10

    SDL GL vs. dglOpenGL

    thx
    C2D X6800, 4GBRAM, NV8800GTX, Vista x64 Ultimate

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
  •