Difference between revisions of "DesktopOpenGLSurface"

From Xojo Documentation

 
(One intermediate revision by the same user not shown)
Line 11: Line 11:
 
{{Event | name=Configure | params=[[MemoryBlock]] | description=Configure(MemoryBlock)
For advanced configuration of the OpenGL context }}
 
{{Event | name=Configure | params=[[MemoryBlock]] | description=Configure(MemoryBlock)
For advanced configuration of the OpenGL context }}
 
{{Event | name=Error | params=[[Boolean]] | description=Error(Boolean)
If OpenGLSurface cannot set up the OpenGL context properly, it will fire this event. }}
 
{{Event | name=Error | params=[[Boolean]] | description=Error(Boolean)
If OpenGLSurface cannot set up the OpenGL context properly, it will fire this event. }}
{{Event | name=Render | link=Render event | description=Render()
Fires when you call the Render method. }}
+
{{Event | name=Render | description=Render()
Fires when you call the Render method. }}
 
{{Event | name=Resized | description=Resized()
The area's size has changed. }}
 
{{Event | name=Resized | description=Resized()
The area's size has changed. }}
 
</dynamicTable>
 
</dynamicTable>
Line 20: Line 20:
 
{{Property | name=DepthBits | type=Integer | platform=all | description=( Integer)&nbsp;&nbsp;The depth of the depth buffer. The default is 24. }}
 
{{Property | name=DepthBits | type=Integer | platform=all | description=( Integer)&nbsp;&nbsp;The depth of the depth buffer. The default is 24. }}
 
{{Property | name=ColorBits | type=Integer | platform=all | description=( Integer)&nbsp;&nbsp;The depth of the color buffer. The default is 24. }}
 
{{Property | name=ColorBits | type=Integer | platform=all | description=( Integer)&nbsp;&nbsp;The depth of the color buffer. The default is 24. }}
{{Property | name=DoubleBuffer | type=Boolean | platform=all | description=( Boolean)&nbsp;&nbsp;Whether or not the surface is double-buffered. The default is True. }}
+
{{Property | name=Composited | type=Boolean | platform=all | description=( Boolean)&nbsp;&nbsp;Whether or not the surface is composited. The default is True. }}
 
</dynamicTable>
 
</dynamicTable>
  

Latest revision as of 22:47, 17 December 2021

Class (inherits from DesktopUIControl)

Sets up OpenGL on all platforms and provides basic functionality. It does the basic setup of OpenGL on each platform. It's up to you to clear buffers and do all the OpenGL drawing.

Events
Closing Error MouseMove
Configure KeyDown MouseUp
ConstructContextualMenu KeyUp MouseWheel
ContextualMenuItemSelected MouseDown Opening
DragEnter MouseDrag Render
DragExit MouseEnter Resized
DragOver MouseExit


Properties
Active fa-lock-32.png Index fa-lock-32.png Parent
AllowAutoDeactivate Left Scope fa-lock-32.png
AllowTabStop LockBottom TabIndex
ColorBits LockLeft Tooltip
Composited LockRight Top
ContextHandle fa-lock-32.png LockTop Transparent
DepthBits MouseCursor Visible
Enabled Name fa-lock-32.png Width
Height PanelIndex Window fa-lock-32.png


Methods
AcceptFileDrop AcceptTextDrop MakeCurrent
AcceptPictureDrop Close Refresh
AcceptRawDataDrop DrawInto SetFocus

Notes

The DesktopOpenGLSurface control and the OpenGL module are based on the OpenGLSurface plug-in from Tinrocket, LLC at http://2002-2010.tinrocket.com/software/openglsurface/index.html.

The OpenGL module contains all the OpenGL calls, functions, and constants that you will need. See http://www.opengl.org/ for the OpenGL documentation. The online version of the Red Book for OpenGL 1.1 is available at http://www.glprogramming.com/red.

Additional information:

  • OpenGL uses a per-thread context.
  • All of the functions in the OpenGL module affect the current context.
  • The current OpenGL context is undefined outside of an DesktopOpenGLSurface Opening, Resized or Render event.
  • DesktopOpenGLSurface.MakeCurrent can be used to make a specific OpenGLCanvas the current context.

See Also

OpenGL module.