mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-02 03:50:35 +02:00
* Part 2 of CVS update...
This commit is contained in:
parent
1f2b762ce4
commit
b22e56bec9
1428
packages/extra/opengl/Makefile
Normal file
1428
packages/extra/opengl/Makefile
Normal file
File diff suppressed because it is too large
Load Diff
28
packages/extra/opengl/Makefile.fpc
Normal file
28
packages/extra/opengl/Makefile.fpc
Normal file
@ -0,0 +1,28 @@
|
||||
#
|
||||
# Makefile.fpc for OpenGL for FPC
|
||||
#
|
||||
|
||||
[package]
|
||||
name=opengl
|
||||
version=1.0.7
|
||||
|
||||
[require]
|
||||
packages_linux=x11
|
||||
packages_freebsd=x11
|
||||
packages_netbsd=x11
|
||||
packages_openbsd=x11
|
||||
|
||||
[target]
|
||||
units=gl glu glut
|
||||
units_linux=dllfuncs glx
|
||||
units_freebsd=dllfuncs glx
|
||||
units_netbsd=dllfuncs glx
|
||||
units_openbsd=dllfuncs glx
|
||||
|
||||
exampledirs=examples
|
||||
|
||||
[install]
|
||||
fpcpackage=y
|
||||
|
||||
[default]
|
||||
fpcdir=../../..
|
46
packages/extra/opengl/glunits.txt
Normal file
46
packages/extra/opengl/glunits.txt
Normal file
@ -0,0 +1,46 @@
|
||||
glunits.zip
|
||||
***************
|
||||
|
||||
These are the Delphi conversions of gl.h, glu.h, glut.h and
|
||||
glext.h. Copy them to your Delphi\Lib directory or somewhere else
|
||||
in your compiler's search path and you're all set!
|
||||
|
||||
To use these units with OpenGL drivers other than Microsoft's,
|
||||
you need to manually initialize three DLL libraries. For example:
|
||||
|
||||
LoadOpenGL('opengl.dll');
|
||||
LoadGLu('glu.dll');
|
||||
LoadGlut('glut.dll'); // Optional
|
||||
|
||||
If you do this, make sure to free the previously loaded library
|
||||
first:
|
||||
|
||||
FreeOpenGL;
|
||||
FreeGLu;
|
||||
FreeGlut;
|
||||
|
||||
If the DLLs the application is trying to load cannot be found, an
|
||||
exception will be raised. By default, the units will try to load
|
||||
OpenGL32.dll, GLu32.dll and Glut32.dll. No exception will be
|
||||
thrown if they are not found, so if you want to support multiple
|
||||
OpenGL implementations in your app, it's probably best to
|
||||
explicitly load the DLLs explicitly as shown above. This way, you
|
||||
can properly trap errors.
|
||||
|
||||
A final note: if you have a 3D card with an OpenGL ICD, you do NOT
|
||||
need to load the driver yourself. Microsoft's OpenGL32.dll will
|
||||
automatically detect and use your 3D card's drivers, so the
|
||||
default settings in these units will work perfectly.
|
||||
|
||||
The fourth file in this archive, glext.pas, contains declarations
|
||||
of constants and function prototypes of most OpenGL extensions.
|
||||
To use an extension, you just need to check if it's supported, and
|
||||
load it's functions with wglGetProcAddress() if it is. You can
|
||||
check the presence of an extension with the included function
|
||||
glext_ExtensionSupported(). By using glext.pas, you no longer have
|
||||
to copy/paste/translate declarations from the extension specs. If
|
||||
you should come across an extension that isn't yet included in
|
||||
glext.pas, I'd appreciate it if you could drop me a line so I can
|
||||
add it ASAP.
|
||||
|
||||
Tom Nuydens (tom@delphi3d.net)
|
Loading…
Reference in New Issue
Block a user