Building a working opengl32.dll?

Charles Huber <[email protected]>
Newsgroups gmane.comp.video.mesa3d.user
Message-ID <CAKPGEKA5j0umxdW-JWKVhzEGofDB4PgeC4HBLEDhXoRU=u1HAg@mail.gmail.com>
For the Mesa 9.0 tarball is there a combination of OS, compiler, and
SCons invocation that will produce a working opengl32.dll for Windows?

I've been trying to run the attached test program (In Debug mode) in
VS2010 Express using FreeGLUT 2.8.0.  It should display a spinning red
square with a blue top-right corner.


Building on Linux (Ubuntu 12.04, MinGW cross-compiler):
scons -j 4 \
build=release \
platform=windows \
toolchain=crossmingw \
mesagdi

Stops on line 36 (glRotatef( angle, 0, 0, 1 );) with:
"First-chance exception at 0x007cc640 in glHarness.exe: 0xC0000005:
Access violation."


Building on Windows 7 (MinGW + MSYS, using the VS2010 Express compiler):
scons.py -j 8 \
build=release \
platform=windows \
mesagdi

Black window while running, hits a heap corruption breakpoint on close:
ntdll.dll!_RtlpBreakPointHeap@4()  + 0x23 bytes	
ntdll.dll!_RtlpCheckBusyBlockTail@8()  + 0x170 bytes	
ntdll.dll!_RtlpValidateHeapEntry@12()  + 0x30e83 bytes	
ntdll.dll!_RtlDebugFreeHeap@12()  + 0x9a bytes	
ntdll.dll!@RtlpFreeHeap@16()  + 0x576fe bytes	
ntdll.dll!_RtlFreeHeap@12()  + 0x54ed bytes	
kernel32.dll!_HeapFree@12()  + 0x14 bytes	
opengl32.dll!free(void * pBlock)  Line 51	
opengl32.dll!_mesa_free_framebuffer_data(gl_framebuffer * fb)  Line
216 + 0x25 bytes
opengl32.dll!_mesa_destroy_framebuffer(gl_framebuffer * fb)  Line 194	
opengl32.dll!_mesa_reference_framebuffer_(gl_framebuffer * * ptr,
gl_framebuffer * fb)  Line 249 + 0x9 bytes
opengl32.dll!_mesa_free_context_data(gl_context * ctx)  Line 1114 + 0x16 bytes	
opengl32.dll!WMesaDestroyContext(wmesa_context * pwc)  Line 1153	
opengl32.dll!wglDeleteContext(HGLRC__ * hglrc)  Line 191	
glHarness.exe!fgCloseWindow(tagSFG_Window * window)  Line 1563	
...


Building on Windows 7 (MinGW + MSYS, using the MinGW compiler):
scons.py \
build=release \
platform=windows \
toolchain=mingw \
mesagdi

Build failed with:
...
  Compiling src\glsl\ir_validate.cpp ...
  Compiling src\glsl\ir_variable_refcount.cpp ...
  Archiving build\windows-x86\mesa\libmesa.a ...
The command line is too long.
scons: *** [build\windows-x86\mesa\libmesa.a] Error 1
scons: building terminated because of errors.

_______________________________________________
mesa-users mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-users
main.cpp (text/x-c++src, 1.7 KB)
#include <GL/glut.h>
#include <iostream>

using namespace std;

double DeltaT()
{
    static double prv = glutGet(GLUT_ELAPSED_TIME) / 1000.0f;
    double cur = glutGet(GLUT_ELAPSED_TIME) / 1000.0f;
    double dt = cur - prv;
    prv = cur;	
    return dt;
}

void display()
{
    double dt = DeltaT();

    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

    glMatrixMode( GL_PROJECTION );
    glLoadIdentity();
    double w = glutGet( GLUT_WINDOW_WIDTH );
    double h = glutGet( GLUT_WINDOW_HEIGHT );
    double ar = w / h;
    glOrtho( -2 * ar, 2 * ar, -2, 2, -1, 1);

    glMatrixMode( GL_MODELVIEW );
    glLoadIdentity();

    static float angle = 0;
    const float DEG_PER_SEC = 60;
    angle += DEG_PER_SEC * dt;

    glPushMatrix();
    glRotatef( angle, 0, 0, 1 );
    glColor3ub( 255, 0, 0 );
    glBegin( GL_QUADS );
    glVertex2i( -1, -1 );
    glVertex2i(  1, -1 );
    glColor3ub( 0, 0, 255 );
    glVertex2i(  1,  1 );
    glColor3ub( 255, 0, 0 );
    glVertex2i( -1,  1 );
    glEnd();

    glPopMatrix();

    glutSwapBuffers();
}

void timer( int extra )
{
    glutPostRedisplay();
    glutTimerFunc(16, timer, 0);
}

int main( int argc, char **argv )
{
    glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE );
    glutInitWindowSize( 640, 480 );
    glutCreateWindow( "GLUT" );

    cout << "GL_VERSION   : " << glGetString( GL_VERSION ) << endl;
    cout << "GL_VENDOR    : " << glGetString( GL_VENDOR ) << endl;
    cout << "GL_RENDERER  : " << glGetString( GL_RENDERER ) << endl; 

    glutDisplayFunc( display );
    glutTimerFunc(0, timer, 0);
    glutMainLoop();
    return 0;
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.