Using GLEE with Borland C++ Builder 6?

Hello,

Im quite new to using GL. I have managed to develop some simple applications in Borland Builder C++ 6, but i need to move forward to using some buffering functionality not supported in openGL 1.1 (i need at least to use OpenGL 2.1). I tried using GLEW with BB6, trying the simplest way:

Moving:
glew32.dll to %SystemRoot%/system32
glew32.lib to {BCB6 Root}/Lib
glew.h to {BCB6 Root}/Include/GL
wglew.h to {BCB6 Root}/Include/GL

Then, i include in my program:

#include <GL\glew.h>

and get the following error when trying to compile:

[C++ Error] glew.h(156): E2238 Multiple declaration for ‘ptrdiff_t’

The error is in this sector of glew.h:

(…)
#if !defined(_PTRDIFF_T_DEFINED) && !defined(PTRDIFF_T)

ifdef _WIN64

typedef __int64 ptrdiff_t;

else

typedef _W64 int ptrdiff_t; <-THIS IS THE LINE WITH THE ERROR

endif

define _PTRDIFF_T_DEFINED

define PTRDIFF_T

#endif
(…)

Does anyone know if BCB6 supports Glew, or if there is any way of doing so? I searched the forum but couldn´t find anything related to GLEE in BCB6 forms applications.

Thanks in advance

Hi

I used GLEW with Borland and it was really easy to start using it.I think you just have to arrange “includes of header files” properly.
BTW if you need it only for some extensions you can simply use the extension headers glext.h and wglext.h (supplied by OpenGL.org) without GLEW or GLEE.After I got used to it I found GLEW unnecessary, at least for my current project.

Thank you very much!

I´m using glext.h and wglext.h and doing perfectly for this project.

I’ll leave my solution here (may help someone else) for a simple example:

I needed to use glBlendColor(red,green,blue,alpha) supported in openg1.2

I copied glext.h and wglext.h from:
http://www.opengl.org/registry/
to my {BCB6 Root}/Include/GL folder

then, included in my project:

#include <GL\glext.h>
#include <GL\wglext.h>

Finally, i coppied in a glExtensions.h:

extern PFNGLBLENDCOLORPROC glBlendColor;

and in my main.cpp

PFNGLBLENDCOLORPROC glBlendColor; //pointer to the ext func
glBlendColor = (PFNGLBLENDCOLORPROC)wglGetProcAddress(“glBlendColor”);

glBlendColor(red,green,blue,alpha);

Thanks!