Openglide on MacOS X

Developer's Forum, for discussion of bugs, code, and other developmental aspects of OpenGLide.

Re: Openglide on MacOS X

Postby gulikoza » 2009-10-23 @ 10:23

Can you post the contents of your modified grSstWinOpen() so that I can see exactly where this prints?

These warnings can possibly be fixed by adding const to prototype of void GLErro( char *Funcao ). Change it to:

Code: Select all
void GLErro( const char *Funcao )


in GLutil.cpp and GlOgl.h.
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-10-23 @ 10:29

starting from line 241 (I may have overdid the glidemsg thing, but I put one in wherever I thought I could add one...)
Code: Select all
grSstWinOpen(   FxU hwnd,
                GrScreenResolution_t res,
                GrScreenRefresh_t ref,
                GrColorFormat_t cformat,
                GrOriginLocation_t org_loc,
                int num_buffers,
                int num_aux_buffers )
{
    GlideMsg( "grSstWinOpen( %d, %d, %d, %d, %d, %d, %d )\n",
        hwnd, res, ref, cformat, org_loc, num_buffers, num_aux_buffers );
    if ( OpenGL.WinOpen )
    {
        grSstWinClose( ); GlideMsg("1");
    }

    if (!InterpretScreenResolution(res, Glide.WindowWidth, Glide.WindowHeight))

    {
#ifdef OGL_DEBUG
        Error( "grSstWinOpen: res = GR_RESOLUTION_NONE\n" );
         GlideMsg("2");
#endif
        return FXFALSE;
         GlideMsg("3");
    }

    if (!InterpretScreenRefresh(ref, OpenGL.Refresh))

    {
#ifdef OGL_DEBUG
        Error( "grSstWinOpen: Refresh Incorrect\n" );
         GlideMsg("4");
#endif
        return FXFALSE;
         GlideMsg("5");
    }

    OpenGL.WindowWidth  = Glide.WindowWidth;
     GlideMsg("6");
    OpenGL.WindowHeight = Glide.WindowHeight;
     GlideMsg("7");
    Glide.WindowTotalPixels = Glide.WindowWidth * Glide.WindowHeight;
     GlideMsg("8");

    OpenGL.WaitSignal = (int)( 1000 / OpenGL.Refresh );
     GlideMsg("9");

    // Initing OpenGL Window
    if ( !InitWindow( hwnd ) )
    {
        return FXFALSE;
         GlideMsg("10");
    }

    Glide.State.ColorFormat = cformat;
     GlideMsg("11");
    Glide.NumBuffers        = num_buffers;
     GlideMsg("12");
    Glide.AuxBuffers        = num_aux_buffers;
     GlideMsg("13");

#ifdef OGL_DONE
    GlideMsg( "grSstWinOpen( %d, %d, %d, %d, %d, %d, %d )\n",
        hwnd, res, ref, cformat, org_loc, num_buffers, num_aux_buffers );
#endif
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby Qbix » 2009-10-23 @ 11:15

maybe move he messages before the return FXFALSE;
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10651
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: Openglide on MacOS X

Postby Dominus » 2009-10-23 @ 12:56

maybe move he messages before the return FXFALSE;

Doesn't change the output, still only 6,7,8,9...

These warnings can possibly be fixed by adding const to prototype of void GLErro( char *Funcao ).

yep, that fixes those warnings.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby gulikoza » 2009-10-23 @ 13:44

so if you add a msg right to the top of InitWindow() (before InitialiseOpenGLWindow call) in Glide.cpp it doesn't print? That would suggest a stack corruption somewhere and make remote debugging much harder :)
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-10-23 @ 13:53

so if you add a msg right to the top of InitWindow() (before InitialiseOpenGLWindow call) in Glide.cpp it doesn't print?
THAT in glide.cpp gets printed! and if I add another message after
InitialiseOpenGLWindow( hWnd, 0, 0, OpenGL.WindowWidth, OpenGL.WindowHeight );
that gets printed as well...
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby gulikoza » 2009-10-23 @ 14:21

So it's the glGetString() that crashes?
There's a testgl.c in SDL sources. Perhaps you could try compiling and running that and see if it works?
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-10-23 @ 17:03

testgl runs fine, a very fast (5318 FPS) spinning colored cube.

I'm going to be away from tomorrow until next friday, so that you know why I'll be silent for the next few days in this thread. I'll still be able to log on here but I'm not going to be able to test anything.

Another thing I forgot to mention and what might be of importance, my SDL is the SDL 1.2.14 prerelease, since 1.2.13 has many problems on OS X 10.6.1
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby gulikoza » 2009-10-23 @ 18:15

Hm. Really strange...
I've checked out 1.2.14, I don't see any differences that should be of concern. And as I understand, 1.2.14 is required for 10.6.1.

Can you try to confirm it is the glGetString that is crashing. Perhaps you can put:

Code: Select all
   GlideMsg( "Vendor     : %s\n", glGetString( GL_VENDOR ) );
   GlideMsg( "Renderer   : %s\n", glGetString( GL_RENDERER ) );
   GlideMsg( "Version    : %s\n", glGetString( GL_VERSION ) );
   GlideMsg( "Extensions : %s\n", glGetString( GL_EXTENSIONS ) );


just after InitialiseOpenGLWindow() and another MSG just before these to see if it gets this far.
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-10-23 @ 22:58

the one msg before that will be printed but those will not.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby wd » 2009-10-24 @ 13:58

the one msg before that will be printed but those will not.

Please post the respective part of that functions, as it should look like
bool InitWindow(whatever) {
InitSomething();
[here the GetStrings from gulikoza]
[here the strcmp with the GetString]

Just add some more logging right after the InitSomething function to isolate
stuff, like use
char* test = glGetString( GL_RENDERER );
with logging before/after that to see if it's glGetString itself that crashes etc.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Openglide on MacOS X

Postby Dominus » 2009-10-25 @ 14:45

I'll post those, when I'm back home. Thanks
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby Dominus » 2009-10-29 @ 19:20

Code: Select all
bool InitWindow( FxU hWnd )
{
    GlideMsg( "glide.cpp #1");
    InitialiseOpenGLWindow( hWnd, 0, 0,  OpenGL.WindowWidth, OpenGL.WindowHeight );
   GlideMsg( "glide.cpp #2" );
   GlideMsg( "Vendor     : %s\n", glGetString( GL_VENDOR ) );
   GlideMsg( "Renderer   : %s\n", glGetString( GL_RENDERER ) );
   GlideMsg( "Version    : %s\n", glGetString( GL_VERSION ) );
   GlideMsg( "Extensions : %s\n", glGetString( GL_EXTENSIONS ) );

"glide.cpp #1" and "glide.cpp #2" are printed in the log file.

Don't know where else to put some logging...

But I'm back in testing business :)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby gulikoza » 2009-10-29 @ 21:12

Yeah, I've been thinking about this for a week too :)
Those functions should not be failing, unless opengl failed to initialize properly. But if that were the case, SDL_SetVideoMode() should fail. The InitialiseOpenGLWindow() should probably be rewritten to return false if open window was unsuccessful so that grSstWinOpen() can fail and return failure to the glide application. I assume there are no "Video mode set failed" errors in the log?
Other than that, I don't have any ideas. SDL OpenGL init is pretty simple and should work (as demonstrated by dosbox and the testgl program)...
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-10-29 @ 21:21

hmm, no such error in the log.
It was a bit unclear to me to what videomode I should set Dosbox, but it fails anyway in surface, overlay and opengl...
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby gulikoza » 2009-10-29 @ 22:26

it shouldn't matter, but I was just about to suggest setting it to opengl. opengl should be initialized by dosbox then, openglide should just change the resolution....very weird it would fail at that...
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby gulikoza » 2009-10-30 @ 06:46

There is another possibility of course. That this is indeed some problem with my dosbox glide patch.
Attached is the simplest possible glide program. It will initialize glide, clear screen to blue and exit. I have no idea if it will compile :happy:
Attachments
BufferClear.zip
(1.33 KiB) Downloaded 453 times
User avatar
gulikoza
Oldbie
 
Posts: 1705
Joined: 2004-6-25 @ 14:53

Re: Openglide on MacOS X

Postby Dominus » 2009-10-30 @ 09:53

Code: Select all
gcc bc.c -I/opt/local/include -I /usr/local/include/openglide/
In file included from /usr/local/include/openglide/sdk2_glide.h:36,
                 from test.h:20,
                 from bc.c:3:
/usr/local/include/openglide/sdk2_3dfx.h:100:4: warning: #warning define FX_ENTRY & FX_CALL for your compiler
Undefined symbols:
  "_grGlideInit", referenced from:
      _main in cc6xwvT0.o
  "_getch", referenced from:
      _main in cc6xwvT0.o
      _main in cc6xwvT0.o
  "_grBufferSwap", referenced from:
      _runTest in cc6xwvT0.o
  "_grSstQueryBoards", referenced from:
      _main in cc6xwvT0.o
  "_grSstWinOpen", referenced from:
      _main in cc6xwvT0.o
  "_grBufferClear", referenced from:
      _runTest in cc6xwvT0.o
  "_grSstSelect", referenced from:
      _main in cc6xwvT0.o
  "_grGlideShutdown", referenced from:
      _main in cc6xwvT0.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
imac:bufferclear dominus$ gcc
i686-apple-darwin10-gcc-4.2.1: no input files

I hope I used the correct command to compile this (I renamed the c file to bc.c to type it faster...)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: Openglide on MacOS X

Postby Qbix » 2009-10-30 @ 10:19

you probably need some -lglide or so
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10651
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: Openglide on MacOS X

Postby Dominus » 2009-11-03 @ 21:50

any ideas on that? -I /usr/local/include/openglide/ is enough to build Dosbox with glide support.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7644
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

PreviousNext

Return to OpenGLide Development

Who is online

Users browsing this forum: No registered users and 1 guest