Click to See Complete Forum and Search --> : Using OpenGl With VC++


rbha311
December 16th, 2008, 08:30 PM
Hi,

I am trying to use openGL libraries with VC++ but i have no idea as to how I should install it, the guides on the openGL website are quite confusing too. It'd be great if someone could help me out with this. I did download the GLUT3.7 directory and after reading the instructions in the readme file I was confused when it described the instructions for VC++. It mentioned specifying the location of the vc++ compiler in the glutwin32.mak file, I do know the location of the compiler but am not sure of as to where to make the change. I'll cut and paste the part of the readme file which mentions the changes that need to be made and the glutwin32.mak file.

-----------------------------------------------------------------------------------------------------------------
MICROSOFT WINDOWS 95 and NT BUILD INSTRUCTIONS: <-- IMPOARTANT!

Read the "README.win" accompanying file. The short instructions if you
have Microsoft's Visual C++ compiler is to run the "glutmake" batch
file. You may need to edit "glutwin32.mak" to indicate your compiler
location.
-----------------------------------------------------------------------------------------------------------------


# Be sure to modify the definitions in this file to agree with your
# systems installation.
# NOTE: be sure that the install directories use '\' not '/' for paths.


# MSVC install directories
LIBINSTALL = \msdev\lib
INCLUDEINSTALL = \msdev\include\GL

# Win95 dll directory
#DLLINSTALL = \windows\system

# WinNT dll directory
DLLINSTALL = \winnt\system32

# Microsoft OpenGL libraries
#
GLU = glu32.lib
OPENGL = opengl32.lib
GLUT = $(TOP)/lib/glut/glut32.lib
GLUTLIB = glut32.lib
GLUTDLL = glut32.dll

# SGI OpenGL for Windows libraries (formerly Cosmo OpenGL)
# >> To use, uncomment lines below and comment out the similiar
# >> lines above. You can download SGI OpenGL for Windows for
# >> free from http://www.meer.net/~gold/OpenGL/opengl2.exe
#
#GLU = \oglsdk\lib\glu.lib
#OPENGL = \oglsdk\lib\opengl.lib
#GLUT = $(TOP)/lib/glut/glut.lib
#GLUTLIB = glut.lib
#GLUTDLL = glut.dll

# The Micro UI lib
MUI = $(TOP)/lib/mui/mui.lib

# The OpenGL Extrusion and Tubing lib
GLE = $(TOP)/lib/gle/gle.lib

# The OpenGL Sphere Mapping lib
GLSMAP = $(TOP)/lib/glsmap/glsmap.lib

# common definitions used by all makefiles
CFLAGS = $(cflags) $(cdebug) $(EXTRACFLAGS) -DWIN32 -I$(TOP)/include
LIBS = $(lflags) $(ldebug) $(EXTRALIBS) $(GLUT) $(GLU) $(OPENGL) $(guilibs)
EXES = $(SRCS:.c=.exe) $(CPPSRCS:.cpp=.exe)

!IFNDEF NODEBUG
lcommon = /NODEFAULTLIB /INCREMENTAL:NO /DEBUG /NOLOGO
!ENDIF

# default rule
default : $(EXES)

# cleanup rules
clean ::
@del /f *.obj
@del /f *.pdb
@del /f *.ilk
@del /f *.ncb
@del /f *~
@del /f *.exp

clobber :: clean
@del /f *.exe
@del /f *.dll
@del /f *.lib
-@del /f $(LDIRT)

# inference rules
$(EXES) : $*.obj $(DEPLIBS)
echo $@
$(link) -out:$@ $** $(LIBS)
.c.obj :
$(CC) $(CFLAGS) $<
.cpp.obj :
$(CC) $(CFLAGS) $<
------------------------------------------------------------------------------------------------------------------


Thanks guys.

Lindley
December 16th, 2008, 11:43 PM
OpenGL 1.3 (I think) comes preinstalled on Windows; no need to do any installation. (GLU comes with it.) If you need OpenGL 2.1 or the OpenGL 3 beta drivers if they're available, check the website of your graphics card vendor (typically AMD, Nvidia, or Intel) for an up-to-date driver. The OpenGL libraries will come with it.

GLUT is a different matter. It's not strictly part of OpenGL, just a layer frequently used with it for beginners since it's convenient. That you'll have to put somewhere on your hard disk, point Visual Studio at its include and library directories, and probably modify your PATH environment variable to point at the dll as well. (Or you could just copy the dll to the VS project build directory.) I believe OpenGLUT may be the most up-to-date version of GLUT.....

I'm afraid I don't know much about Makefiles; personally I'd just modify the VS project you're trying to build with the include and lib dirs.

Also, if you're going to want to use any OpenGL extensions, it would be a good idea to download either GLEW or GLee----they both do essentially the same thing.

jibyz
December 17th, 2008, 08:17 AM
Hello,

I have a 3D camera and receive some data by him. I have an c++-application which allow me to get the pixel value (like r) from the cange, intensity, gray,... als unsigned char or unsigned short) camera...
Now i want to convert this values to get the image (2D or 3D or twice).
Please can you tell me how i can do it using an applicationn or by expanding my application?

What is the difference between OpenCV and OpenGL?

Can you send me too your code or sample code for understanding?

My application is a console application with Visual Studio C++ 2005

Cheers,
jibyz