I just figured out how to create a Window with OpenGL context on OSX Lion with PB 5.11 beta 1 (x64) as AGL doesn't work anymore on cocoa apps.
Code: Select all
InitSprite()
ImportC "/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl.h"
glClear(color.l)
glClearColor(r.f,g.f,b.f,a.f)
EndImport
#GL_COLOR_BUFFER_BIT = $00004000
#GL_DEPTH_BUFFER_BIT = $00000100
OpenWindow (0, 100, 100, 256, 256, "OpenGL Window")
OpenWindowedScreen(WindowID(0), 0, 0, 256, 256, 0, 0, 0)
Repeat
Select WaitWindowEvent(10)
Case #PB_Event_CloseWindow
Break
Default
glClearColor(1, 0.5, 0, 0)
glClear(#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT)
FlipBuffers()
EndSelect
ForEver



