realbasic-games
[Top] [All Lists]

Re: [ResEx] OpenGL in RB

To: <realbasic-games at lists dot realsoftware dot com>
Subject: Re: [ResEx] OpenGL in RB
From: Thomas Cunningham <mauitom at maui dot net>
Date: Sun, 21 Nov 2004 15:42:27 -1000
Delivered-to: realbasic-games at lists dot realsoftware dot com
> I think that's it anyway.

Almost, it's left, bottom, width, height.

In our parsed declares, using OGL syntax and just drawing to a window, this
works here on OS X.

  dim bounds as MemoryBlock
  bounds = NewMemoryBlock(16)
  
  if drawingAreaWidth > WindowWidth then
    MsgBox "error. DefineBounds."
  End

  // centers the drawing area width in the window
  // OGL coordinate system origin in bottom left.

  bounds.long(0) =  (WindowWidth - drawingAreaWidth) / 2   'Left
  bounds.long(4) = drawingAreaBottom          ' Bottom
  bounds.long(8) = drawingAreaWidth            ' Width
  bounds.long(12) = drawingAreaHeight         ' Height from bottom
  
  Dim OK As Boolean
  OK = aglEnable(ctx, AGL_BUFFER_RECT)
  OK = aglSetInteger(ctx, AGL_BUFFER_RECT, bounds)

Thanks, Asher, Seth. I had not used this function yet.

I added this feature to my latest OGL demo that uses two fog routines and
the ever popular cube.
Compiled application and project code at,

http://www.maui.net/~mauitom/OpenGL.html

Thomas C.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>