我在帧缓冲区对象(FBO)的命令glGenFramebuffersEXT上有“访问冲突”:
void TGLForm::DrawScene()
{
wglMakeCurrent(ghDC, ghRC);
glEnable(GL_TEXTURE_2D);
GLuint framebuffer, texturefbo;
GLenum status;
glGenFramebuffersEXT(1, &framebuffer); // access violation here
创建了一个关于FBO的帮助线程,我检查了glext.h的初始化是否正常,并以这种方式在预处理器行中重复:
#include "glext.h"
#include "wglext.h"
extern PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)wglGetProcAddress("glGenFramebuffersEXT");
extern PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)wglGetProcAddress("glBindFramebufferEXT");
extern PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)wglGetProcAddress("glFramebufferTexture2DEXT");
extern PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)wglGetProcAddress("glCheckFramebufferStatusEXT");
extern PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)wglGetProcAddress("glGenRenderbuffersEXT");
extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)wglGetProcAddress("glBindRenderbufferEXT");
extern PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)wglGetProcAddress("glRenderbufferStorageEXT");
extern PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)wglGetProcAddress("glFramebufferRenderbufferEXT");
=>访问冲突仍然存在。
另一个帮助帖子诱使我下载NVIDIA OpenGL SDK,因为我有一张GT9800 Nvidia卡:它没有删除“访问冲突”。
我尝试在Borland Builder 6中使用GLee和Glew:
在Borland中包含Glew,首先需要将Visual Studio“coff”lib从coff转换为borland builder“omf”lib,
但是使用borland命令脚本“coff2omf.exe”我收到此错误标签:“无效的机器类型” - 并且使用“objconv.exe”我收到此错误:“导入库无法转换为静态库”
=>有人知道如何成功地将Glew“coff”lib转换为Borland Builder格式“omf”吗?
=>我们如何将“导入库”转换为“静态库”?
答案 0 :(得分:0)
下载并使用GLEW .h, .c源代码
#define GLEW_STATIC
#include "gl\glew.c" // ~900KB file !!!
不要忘记先搞砸
glewInit();
检查您是否有FBO支持
if (glGenFramebuffersEXT==NULL) error ...
FBO用法