SCREENGLPROC
- 来源: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgScreenglproc
- 最后更新: 2016-02-10
获取 OpenGL 过程的地址
语法
declare function ScreenGLProc ( byref procname as const string ) as any ptr参数
procname
要获取地址的过程名称
说明
此函数可用于获取任何 OpenGL 过程的地址,用于检索与 OpenGL 扩展关联的新函数指针。如果找不到名为 procname 的过程,screenglproc 将返回 NULL(0)。
示例
start GeSHi
vb
'' include fbgfx.bi for some useful definitions
#include "fbgfx.bi"
Dim SwapInterval As Function(ByVal interval As Integer) As Integer
Dim extensions As String
'' Setup OpenGL and retrieve supported extensions
ScreenRes 640, 480, 32,, FB.GFX_OPENGL
ScreenControl FB.GET_GL_EXTENSIONS, extensions
If (InStr(extensions, "WGL_EXT_swap_control") <> 0) Then
'' extension supported, retrieve proc address
SwapInterval = ScreenGLProc("wglSwapIntervalEXT")
If (SwapInterval <> 0) Then
'' Ok, we got it. Set OpenGL to wait for vertical sync on buffer swaps
SwapInterval(1)
End If
End Ifend GeSHi
方言差异
- 在 -lang qb 方言中不可用,除非使用别名
__Screenglproc引用。
平台差异
- 不适用于 DOS 目标。
与 QB 的区别
- FreeBASIC 新增
另请参阅
Screen (Graphics)ScreenControl
返回 目录