Mailing List
Home
Forum Home
Mac Game - Mac game development
Rivers of MUD - a Diku and Merc based multiuser dungeon
SMAUG
Subjects
Getting UDP through NAT/firewalls/whatever for a game
Getting UDP through NAT/firewalls/whatever for a game
QuickTime errors
Python script as stand alone MUD server
Various sound problems
Fragment Shaders & GL TEXTURE RECTANGLE EXT
Timers and global variables
Re: Language and platform for Text MUD server
Apparent acquisition of Yantis (mysupersales) by IDE
HID keyboard
Getting UDP through NAT/firewalls/whatever for a game
Microsoft Sparkle
Director MX
Congratulations Horizons
Yet more problems fullscreen mode
Apple Dev Kitchen Them 's tasty vittles, Maw!
NSOpenGLContext, Pbuffers, and drawables
More DCR "theft " naughtiness
dynamic sprite creation and imaging lingo
Re: Find stuff in Flash array?
Effects of skill imbalances?
QuickTime errors
Rom 2 4/Quickmud Enhancement/Bug fix
Working with XML files/CFURL
smooth scrolling/subpixel tweening
RE: (Ron help me?) Flash text
Flash Racing
MudDev FAQ 2
Browser based games
Installing GLUT
Special character in Flash XML
 
OpenGL on Intel Bug - 10.4.7

OpenGL on Intel Bug - 10.4.7

2006-07-03       - By Alexei Svitkine

 Back
Reply:     1     2  

Hi,

There appears to be a bug on the Mac OS X 10.4.7 Intel OpenGL  
implementation as of the 10.4.7 update (10.4.6 didn't have it), and  
it is also unrelated to the Combo vs Delta missing OpenGL files bug  
that's affected WoW.

Our code goes thus (snipped for clarity):

  pixmap = malloc( BITMAP_TEXTURE_SQUARE * BITMAP_TEXTURE_SQUARE * (1  
<< bitmap->pixel_upshift) ) ;
  if( !pixmap )
  {
    error_message(_error_out_of_memory, __FILE__, __LINE__, "couldn't  
allocate memory for pixmap");
    goto _draw_bitmap_opengl_eom;
  }

  for (j = 0;j < rectangle2d_height(bounds); j += BITMAP_TEXTURE_SQUARE)
    for (i = 0; i < rectangle2d_width(bounds); i += BITMAP_TEXTURE_SQUARE)
    {
      // read part of the bitmap into the buffer
      copy_bitmap_into_buffer( pixmap, i, j, BITMAP_TEXTURE_SQUARE,  
BITMAP_TEXTURE_SQUARE, bitmap ) ;

      glTexImage2D( GL_TEXTURE_2D, 0, internalformat,  
BITMAP_TEXTURE_SQUARE, BITMAP_TEXTURE_SQUARE, 0, format, type,  
pixmap ) ;
   
      // 2. draw a textured rectangle at bound
      glBegin( GL_TRIANGLE_FAN ) ;
     
      glTexCoord2f( 0, 0 ) ;
      glVertex2f( bounds->left + (i), bounds->top + (j) ) ;
     
      glTexCoord2f( 0, 1 ) ;
      glVertex2f( bounds->left + (i), bounds->top + (j +  
BITMAP_TEXTURE_SQUARE) ) ;
     
      glTexCoord2f( 1, 1 ) ;
      glVertex2f( bounds->left + (i + BITMAP_TEXTURE_SQUARE), bounds-
>top + (j + BITMAP_TEXTURE_SQUARE) ) ;
     
      glTexCoord2f( 1, 0 ) ;
      glVertex2f( bounds->left + (i + BITMAP_TEXTURE_SQUARE), bounds-
>top + (j) ) ;
     
      glEnd() ;
    }

What it's doing is, it allocates one single buffer for pixels, and  
draw a large bitmap by drawing BITMAP_TEXTURE_SQUARE x  
BITMAP_TEXTURE_SQUARE squares of it. It's reusing the buffer. On all  
previous Mac OS X updates, and on 10.4.7 on PPC Macs, this works  
perfectly.

However, as of 10.4.7 on Intel-processor Macs, it repeats the first  
square that was copied into the buffer, and doesn't update it once  
new data is copied into it and glTexImage2D is called again. Again,  
this behaviour differs from everything but Intel Macs with 10.4.7  
(works fine on PPC macs and on Windows).

This is most frustrating - as a simple work around we can allocate a  
new buffer for each square with malloc and then free it after, but  
this is super inefficient. :(

-Alexei Svitkine
Project Magma
http://projectmagma.net

__ ____ ____ ____ ____ ____ ____ ____ ____ ____
Do not post admin requests to the list. They will be ignored.
Mac-games-dev mailing list      (Mac-games-dev@(protected))
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-games-dev/junlu%405341.com

This email sent to junlu@(protected)