Initial commit
This commit is contained in:
25
documents/Tesselation_Tutorial/Tesselation.sln
Normal file
25
documents/Tesselation_Tutorial/Tesselation.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual C++ Express 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tesselation", "src\Tesselation.vcxproj", "{98864040-E723-43CF-9479-6FBCDF2F6C51}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{98864040-E723-43CF-9479-6FBCDF2F6C51}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{98864040-E723-43CF-9479-6FBCDF2F6C51}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{98864040-E723-43CF-9479-6FBCDF2F6C51}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{98864040-E723-43CF-9479-6FBCDF2F6C51}.Debug|x64.Build.0 = Debug|x64
|
||||
{98864040-E723-43CF-9479-6FBCDF2F6C51}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{98864040-E723-43CF-9479-6FBCDF2F6C51}.Release|Win32.Build.0 = Release|Win32
|
||||
{98864040-E723-43CF-9479-6FBCDF2F6C51}.Release|x64.ActiveCfg = Release|x64
|
||||
{98864040-E723-43CF-9479-6FBCDF2F6C51}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
BIN
documents/Tesselation_Tutorial/Tesselation.suo
Normal file
BIN
documents/Tesselation_Tutorial/Tesselation.suo
Normal file
Binary file not shown.
BIN
documents/Tesselation_Tutorial/bin32/glut32.dll
Normal file
BIN
documents/Tesselation_Tutorial/bin32/glut32.dll
Normal file
Binary file not shown.
BIN
documents/Tesselation_Tutorial/bin64/Tesselation.exe
Normal file
BIN
documents/Tesselation_Tutorial/bin64/Tesselation.exe
Normal file
Binary file not shown.
BIN
documents/Tesselation_Tutorial/bin64/glut32.dll
Normal file
BIN
documents/Tesselation_Tutorial/bin64/glut32.dll
Normal file
Binary file not shown.
6495
documents/Tesselation_Tutorial/ext/GL/glext.h
Normal file
6495
documents/Tesselation_Tutorial/ext/GL/glext.h
Normal file
File diff suppressed because it is too large
Load Diff
126
documents/Tesselation_Tutorial/ext/GL/glut.def
Normal file
126
documents/Tesselation_Tutorial/ext/GL/glut.def
Normal file
@@ -0,0 +1,126 @@
|
||||
DESCRIPTION 'OpenGL Utility Toolkit for Win32'
|
||||
|
||||
VERSION 3.7
|
||||
|
||||
EXPORTS
|
||||
|
||||
glutAddMenuEntry
|
||||
glutAddSubMenu
|
||||
glutAttachMenu
|
||||
glutBitmapCharacter
|
||||
glutBitmapLength
|
||||
glutBitmapWidth
|
||||
glutButtonBoxFunc
|
||||
glutChangeToMenuEntry
|
||||
glutChangeToSubMenu
|
||||
glutCopyColormap
|
||||
glutCreateMenu
|
||||
__glutCreateMenuWithExit
|
||||
glutCreateSubWindow
|
||||
glutCreateWindow
|
||||
__glutCreateWindowWithExit
|
||||
glutDestroyMenu
|
||||
glutDestroyWindow
|
||||
glutDetachMenu
|
||||
glutDeviceGet
|
||||
glutDialsFunc
|
||||
glutDisplayFunc
|
||||
glutEnterGameMode
|
||||
glutEntryFunc
|
||||
glutEstablishOverlay
|
||||
glutExtensionSupported
|
||||
glutForceJoystickFunc
|
||||
glutFullScreen
|
||||
glutGameModeGet
|
||||
glutGameModeString
|
||||
glutGet
|
||||
glutGetColor
|
||||
glutGetMenu
|
||||
glutGetModifiers
|
||||
glutGetWindow
|
||||
glutHideOverlay
|
||||
glutHideWindow
|
||||
glutIconifyWindow
|
||||
glutIdleFunc
|
||||
glutIgnoreKeyRepeat
|
||||
glutInit
|
||||
__glutInitWithExit
|
||||
glutInitDisplayMode
|
||||
glutInitDisplayString
|
||||
glutInitWindowPosition
|
||||
glutInitWindowSize
|
||||
glutJoystickFunc
|
||||
glutKeyboardFunc
|
||||
glutKeyboardUpFunc
|
||||
glutLayerGet
|
||||
glutLeaveGameMode
|
||||
glutMainLoop
|
||||
glutMenuStateFunc
|
||||
glutMenuStatusFunc
|
||||
glutMotionFunc
|
||||
glutMouseFunc
|
||||
glutOverlayDisplayFunc
|
||||
glutPassiveMotionFunc
|
||||
glutPopWindow
|
||||
glutPositionWindow
|
||||
glutPostOverlayRedisplay
|
||||
glutPostRedisplay
|
||||
glutPostWindowOverlayRedisplay
|
||||
glutPostWindowRedisplay
|
||||
glutPushWindow
|
||||
glutRemoveMenuItem
|
||||
glutRemoveOverlay
|
||||
glutReportErrors
|
||||
glutReshapeFunc
|
||||
glutReshapeWindow
|
||||
glutSetColor
|
||||
glutSetCursor
|
||||
glutSetIconTitle
|
||||
glutSetKeyRepeat
|
||||
glutSetMenu
|
||||
glutSetWindow
|
||||
glutSetWindowTitle
|
||||
glutSetupVideoResizing
|
||||
glutShowOverlay
|
||||
glutShowWindow
|
||||
glutSolidCone
|
||||
glutSolidCube
|
||||
glutSolidDodecahedron
|
||||
glutSolidIcosahedron
|
||||
glutSolidOctahedron
|
||||
glutSolidSphere
|
||||
glutSolidTeapot
|
||||
glutSolidTetrahedron
|
||||
glutSolidTorus
|
||||
glutSpaceballButtonFunc
|
||||
glutSpaceballMotionFunc
|
||||
glutSpaceballRotateFunc
|
||||
glutSpecialFunc
|
||||
glutSpecialUpFunc
|
||||
glutStopVideoResizing
|
||||
glutStrokeCharacter
|
||||
glutStrokeLength
|
||||
glutStrokeWidth
|
||||
glutSwapBuffers
|
||||
glutTabletButtonFunc
|
||||
glutTabletMotionFunc
|
||||
glutTimerFunc
|
||||
glutUseLayer
|
||||
glutVideoPan
|
||||
glutVideoResize
|
||||
glutVideoResizeGet
|
||||
glutVisibilityFunc
|
||||
glutWarpPointer
|
||||
glutWindowStatusFunc
|
||||
glutWireCone
|
||||
glutWireCube
|
||||
glutWireDodecahedron
|
||||
glutWireIcosahedron
|
||||
glutWireOctahedron
|
||||
glutWireSphere
|
||||
glutWireTeapot
|
||||
glutWireTetrahedron
|
||||
glutWireTorus
|
||||
; __glutSetFCB
|
||||
; __glutGetFCB
|
||||
|
||||
787
documents/Tesselation_Tutorial/ext/GL/glut.h
Normal file
787
documents/Tesselation_Tutorial/ext/GL/glut.h
Normal file
@@ -0,0 +1,787 @@
|
||||
#ifndef __glut_h__
|
||||
#define __glut_h__
|
||||
|
||||
/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998, 2000, 2006. */
|
||||
|
||||
/* This program is freely distributable without licensing fees and is
|
||||
provided without guarantee or warrantee expressed or implied. This
|
||||
program is -not- in the public domain. */
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
/* GLUT 3.7 now tries to avoid including <windows.h>
|
||||
to avoid name space pollution, but Win32's <GL/gl.h>
|
||||
needs APIENTRY and WINGDIAPI defined properly. */
|
||||
# if 0
|
||||
/* This would put tons of macros and crap in our clean name space. */
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
# else
|
||||
/* XXX This is from Win32's <windef.h> */
|
||||
# ifndef APIENTRY
|
||||
# define GLUT_APIENTRY_DEFINED
|
||||
/* Cygwin and MingW32 are two free GNU-based Open Source compilation
|
||||
environments for Win32. Note that __CYGWIN32__ is deprecated
|
||||
in favor of simply __CYGWIN__. */
|
||||
# if defined(__MINGW32__) || defined(__CYGWIN32__) || defined(__CYGWIN__)
|
||||
# ifdef i386
|
||||
# define APIENTRY __attribute__((stdcall))
|
||||
# else
|
||||
# define APIENTRY
|
||||
# endif
|
||||
# else
|
||||
# if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
|
||||
# define APIENTRY __stdcall
|
||||
# else
|
||||
# define APIENTRY
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
/* XXX This is from Win32's <winnt.h> */
|
||||
# ifndef CALLBACK
|
||||
# if defined(__MINGW32__) || defined(__CYGWIN32__) || defined(__CYGWIN__)
|
||||
# ifndef __stdcall
|
||||
# define __stdcall __attribute__((stdcall))
|
||||
# endif
|
||||
# define CALLBACK __stdcall
|
||||
# else
|
||||
# if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
|
||||
# define CALLBACK __stdcall
|
||||
# else
|
||||
# define CALLBACK
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
/* XXX This is from Win32's <wingdi.h> and <winnt.h> */
|
||||
# ifndef WINGDIAPI
|
||||
# define GLUT_WINGDIAPI_DEFINED
|
||||
# if defined(__MINGW32__) || defined(__CYGWIN32__) || defined(__CYGWIN__)
|
||||
# define WINGDIAPI
|
||||
# else
|
||||
# define WINGDIAPI __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
# if defined(__MINGW32__) || defined(__CYGWIN32__) || defined(__CYGWIN__)
|
||||
/* Rely on Cygwin32/MingW32 <stddef.h> to set wchar_t. */
|
||||
/* XXX Warning. The Cygwin32/MingW32 definition for wchar_t
|
||||
is an "int" instead of the "short" used by Windows. */
|
||||
# include <stddef.h>
|
||||
# else
|
||||
/* XXX This is from Win32's <ctype.h> */
|
||||
# ifndef _WCHAR_T_DEFINED
|
||||
typedef unsigned short wchar_t;
|
||||
# define _WCHAR_T_DEFINED
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
|
||||
in your compile preprocessor options. */
|
||||
# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
|
||||
# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */
|
||||
# pragma comment (lib, "user32.lib") /* link with Windows User lib */
|
||||
# pragma comment (lib, "gdi32.lib") /* link with Windows GDI lib */
|
||||
/* To enable automatic SGI OpenGL for Windows library usage for GLUT,
|
||||
define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */
|
||||
# ifdef GLUT_USE_SGI_OPENGL
|
||||
# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */
|
||||
# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */
|
||||
# if defined(GLUT_STATIC_LIB)
|
||||
# pragma comment (lib, "glutstatic.lib") /* link with static Win32 GLUT lib */
|
||||
# else
|
||||
# pragma comment (lib, "glut.lib") /* link with Win32 GLUT lib */
|
||||
# endif
|
||||
# else
|
||||
# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
|
||||
# pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */
|
||||
# if defined(GLUT_STATIC_LIB)
|
||||
# pragma comment (lib, "glutstatic.lib") /* link with static Win32 GLUT lib */
|
||||
# else
|
||||
# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* To disable supression of annoying warnings about floats being promoted
|
||||
to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor
|
||||
options. */
|
||||
# if defined(_MSC_VER) && !defined(GLUT_NO_WARNING_DISABLE)
|
||||
# pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */
|
||||
# pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */
|
||||
# endif
|
||||
|
||||
/* Win32 has an annoying issue where there are multiple C run-time
|
||||
libraries (CRTs). If the executable is linked with a different CRT
|
||||
from the GLUT DLL, the GLUT DLL will not share the same CRT static
|
||||
data seen by the executable. In particular, atexit callbacks registered
|
||||
in the executable will not be called if GLUT calls its (different)
|
||||
exit routine). GLUT is typically built with the
|
||||
"/MD" option (the CRT with multithreading DLL support), but the Visual
|
||||
C++ linker default is "/ML" (the single threaded CRT).
|
||||
|
||||
One workaround to this issue is requiring users to always link with
|
||||
the same CRT as GLUT is compiled with. That requires users supply a
|
||||
non-standard option. GLUT 3.7 has its own built-in workaround where
|
||||
the executable's "exit" function pointer is covertly passed to GLUT.
|
||||
GLUT then calls the executable's exit function pointer to ensure that
|
||||
any "atexit" calls registered by the application are called if GLUT
|
||||
needs to exit.
|
||||
|
||||
Note that the __glut*WithExit routines should NEVER be called directly.
|
||||
To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
|
||||
|
||||
/* XXX This is from Win32's <process.h> */
|
||||
# if !defined(_MSC_VER) && !defined(__cdecl)
|
||||
/* Define __cdecl for non-Microsoft compilers. */
|
||||
# define __cdecl
|
||||
# define GLUT_DEFINED___CDECL
|
||||
# endif
|
||||
# ifndef _CRTIMP
|
||||
# ifdef _NTSDK
|
||||
/* Definition compatible with NT SDK */
|
||||
# define _CRTIMP
|
||||
# else
|
||||
/* Current definition */
|
||||
# ifdef _DLL
|
||||
# define _CRTIMP __declspec(dllimport)
|
||||
# else
|
||||
# define _CRTIMP
|
||||
# endif
|
||||
# endif
|
||||
# define GLUT_DEFINED__CRTIMP
|
||||
# endif
|
||||
|
||||
/* GLUT API entry point declarations for Win32. */
|
||||
# ifdef GLUT_BUILDING_LIB
|
||||
/* MSDN article 835326 says "When you build a DLL by using the 64-bit
|
||||
version of the Microsoft Visual C++ Compiler and Linker, you may
|
||||
receive Linker error number LNK4197 if a function has been declared
|
||||
for export more than one time." GLUT builds with glut.def that
|
||||
declares GLUT's EXPORTS list so do not use __declspec(dllexport)
|
||||
to keep 64-bit compiler happy. */
|
||||
# define GLUTAPI /*__declspec(dllexport)*/
|
||||
# else
|
||||
# ifdef _DLL
|
||||
# define GLUTAPI __declspec(dllimport)
|
||||
# else
|
||||
# define GLUTAPI extern
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* GLUT callback calling convention for Win32. */
|
||||
# define GLUTCALLBACK __cdecl
|
||||
|
||||
# if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
|
||||
# define GLUTAPIENTRY __stdcall
|
||||
# else
|
||||
# define GLUTAPIENTRY
|
||||
# endif
|
||||
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifndef GLUT_BUILDING_LIB
|
||||
# if __BORLANDC__
|
||||
# if defined(_BUILDRTLDLL)
|
||||
void __cdecl __export exit(int __status);
|
||||
# else
|
||||
void __cdecl exit(int __status);
|
||||
# endif
|
||||
# else
|
||||
# if _MSC_VER >= 1200
|
||||
extern _CRTIMP __declspec(noreturn) void __cdecl exit(int);
|
||||
# else
|
||||
extern _CRTIMP void __cdecl exit(int);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
/* non-Win32 case. */
|
||||
/* Define APIENTRY and CALLBACK to nothing if we aren't on Win32. */
|
||||
# define APIENTRY
|
||||
# define GLUT_APIENTRY_DEFINED
|
||||
# define CALLBACK
|
||||
/* Define GLUTAPI and GLUTCALLBACK as below if we aren't on Win32. */
|
||||
# define GLUTAPI extern
|
||||
# define GLUTAPIENTRY
|
||||
# define GLUTCALLBACK
|
||||
/* Prototype exit for the non-Win32 case (see above). */
|
||||
# ifdef __GNUC__
|
||||
extern void exit(int __status) __attribute__((__noreturn__));
|
||||
# else
|
||||
extern void exit(int);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
GLUT API revision history:
|
||||
|
||||
GLUT_API_VERSION is updated to reflect incompatible GLUT
|
||||
API changes (interface changes, semantic changes, deletions,
|
||||
or additions).
|
||||
|
||||
GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
|
||||
|
||||
GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling,
|
||||
extension. Supports new input devices like tablet, dial and button
|
||||
box, and Spaceball. Easy to query OpenGL extensions.
|
||||
|
||||
GLUT_API_VERSION=3 glutMenuStatus added.
|
||||
|
||||
GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer,
|
||||
glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
|
||||
video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
|
||||
glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
|
||||
glutJoystickFunc, glutForceJoystickFunc, glutStrokeWidthf,
|
||||
glutStrokeLengthf (NOT FINALIZED!).
|
||||
**/
|
||||
#ifndef GLUT_API_VERSION /* allow this to be overriden */
|
||||
#define GLUT_API_VERSION 3
|
||||
#endif
|
||||
|
||||
/**
|
||||
GLUT implementation revision history:
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
|
||||
API revisions and implementation revisions (ie, bug fixes).
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of
|
||||
GLUT Xlib-based implementation. 11/29/94
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of
|
||||
GLUT Xlib-based implementation providing GLUT version 2
|
||||
interfaces.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner
|
||||
and video resize. 1/3/97
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa <GL/glut.h>
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=16 mjk's early GLUT 3.8
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=17 mjk's GLUT 3.8 with glutStrokeWidthf and glutStrokeLengthf
|
||||
**/
|
||||
#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */
|
||||
#define GLUT_XLIB_IMPLEMENTATION 17
|
||||
#endif
|
||||
|
||||
/* Display mode bit masks. */
|
||||
#define GLUT_RGB 0
|
||||
#define GLUT_RGBA GLUT_RGB
|
||||
#define GLUT_INDEX 1
|
||||
#define GLUT_SINGLE 0
|
||||
#define GLUT_DOUBLE 2
|
||||
#define GLUT_ACCUM 4
|
||||
#define GLUT_ALPHA 8
|
||||
#define GLUT_DEPTH 16
|
||||
#define GLUT_STENCIL 32
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
#define GLUT_MULTISAMPLE 128
|
||||
#define GLUT_STEREO 256
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
#define GLUT_LUMINANCE 512
|
||||
#endif
|
||||
|
||||
/* Mouse buttons. */
|
||||
#define GLUT_LEFT_BUTTON 0
|
||||
#define GLUT_MIDDLE_BUTTON 1
|
||||
#define GLUT_RIGHT_BUTTON 2
|
||||
|
||||
/* Mouse button state. */
|
||||
#define GLUT_DOWN 0
|
||||
#define GLUT_UP 1
|
||||
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
/* function keys */
|
||||
#define GLUT_KEY_F1 1
|
||||
#define GLUT_KEY_F2 2
|
||||
#define GLUT_KEY_F3 3
|
||||
#define GLUT_KEY_F4 4
|
||||
#define GLUT_KEY_F5 5
|
||||
#define GLUT_KEY_F6 6
|
||||
#define GLUT_KEY_F7 7
|
||||
#define GLUT_KEY_F8 8
|
||||
#define GLUT_KEY_F9 9
|
||||
#define GLUT_KEY_F10 10
|
||||
#define GLUT_KEY_F11 11
|
||||
#define GLUT_KEY_F12 12
|
||||
/* directional keys */
|
||||
#define GLUT_KEY_LEFT 100
|
||||
#define GLUT_KEY_UP 101
|
||||
#define GLUT_KEY_RIGHT 102
|
||||
#define GLUT_KEY_DOWN 103
|
||||
#define GLUT_KEY_PAGE_UP 104
|
||||
#define GLUT_KEY_PAGE_DOWN 105
|
||||
#define GLUT_KEY_HOME 106
|
||||
#define GLUT_KEY_END 107
|
||||
#define GLUT_KEY_INSERT 108
|
||||
#endif
|
||||
|
||||
/* Entry/exit state. */
|
||||
#define GLUT_LEFT 0
|
||||
#define GLUT_ENTERED 1
|
||||
|
||||
/* Menu usage state. */
|
||||
#define GLUT_MENU_NOT_IN_USE 0
|
||||
#define GLUT_MENU_IN_USE 1
|
||||
|
||||
/* Visibility state. */
|
||||
#define GLUT_NOT_VISIBLE 0
|
||||
#define GLUT_VISIBLE 1
|
||||
|
||||
/* Window status state. */
|
||||
#define GLUT_HIDDEN 0
|
||||
#define GLUT_FULLY_RETAINED 1
|
||||
#define GLUT_PARTIALLY_RETAINED 2
|
||||
#define GLUT_FULLY_COVERED 3
|
||||
|
||||
/* Color index component selection values. */
|
||||
#define GLUT_RED 0
|
||||
#define GLUT_GREEN 1
|
||||
#define GLUT_BLUE 2
|
||||
|
||||
#ifdef _WIN32
|
||||
/* Stroke font constants (use these in GLUT program). */
|
||||
#define GLUT_STROKE_ROMAN ((void*)0)
|
||||
#define GLUT_STROKE_MONO_ROMAN ((void*)1)
|
||||
|
||||
/* Bitmap font constants (use these in GLUT program). */
|
||||
#define GLUT_BITMAP_9_BY_15 ((void*)2)
|
||||
#define GLUT_BITMAP_8_BY_13 ((void*)3)
|
||||
#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
|
||||
#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
#define GLUT_BITMAP_HELVETICA_10 ((void*)6)
|
||||
#define GLUT_BITMAP_HELVETICA_12 ((void*)7)
|
||||
#define GLUT_BITMAP_HELVETICA_18 ((void*)8)
|
||||
#endif
|
||||
#else
|
||||
/* Stroke font opaque addresses (use constants instead in source code). */
|
||||
GLUTAPI void *glutStrokeRoman;
|
||||
GLUTAPI void *glutStrokeMonoRoman;
|
||||
|
||||
/* Stroke font constants (use these in GLUT program). */
|
||||
#define GLUT_STROKE_ROMAN (&glutStrokeRoman)
|
||||
#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
|
||||
|
||||
/* Bitmap font opaque addresses (use constants instead in source code). */
|
||||
GLUTAPI void *glutBitmap9By15;
|
||||
GLUTAPI void *glutBitmap8By13;
|
||||
GLUTAPI void *glutBitmapTimesRoman10;
|
||||
GLUTAPI void *glutBitmapTimesRoman24;
|
||||
GLUTAPI void *glutBitmapHelvetica10;
|
||||
GLUTAPI void *glutBitmapHelvetica12;
|
||||
GLUTAPI void *glutBitmapHelvetica18;
|
||||
|
||||
/* Bitmap font constants (use these in GLUT program). */
|
||||
#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
|
||||
#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
|
||||
#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
|
||||
#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
|
||||
#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
|
||||
#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* glutGet parameters. */
|
||||
#define GLUT_WINDOW_X ((GLenum) 100)
|
||||
#define GLUT_WINDOW_Y ((GLenum) 101)
|
||||
#define GLUT_WINDOW_WIDTH ((GLenum) 102)
|
||||
#define GLUT_WINDOW_HEIGHT ((GLenum) 103)
|
||||
#define GLUT_WINDOW_BUFFER_SIZE ((GLenum) 104)
|
||||
#define GLUT_WINDOW_STENCIL_SIZE ((GLenum) 105)
|
||||
#define GLUT_WINDOW_DEPTH_SIZE ((GLenum) 106)
|
||||
#define GLUT_WINDOW_RED_SIZE ((GLenum) 107)
|
||||
#define GLUT_WINDOW_GREEN_SIZE ((GLenum) 108)
|
||||
#define GLUT_WINDOW_BLUE_SIZE ((GLenum) 109)
|
||||
#define GLUT_WINDOW_ALPHA_SIZE ((GLenum) 110)
|
||||
#define GLUT_WINDOW_ACCUM_RED_SIZE ((GLenum) 111)
|
||||
#define GLUT_WINDOW_ACCUM_GREEN_SIZE ((GLenum) 112)
|
||||
#define GLUT_WINDOW_ACCUM_BLUE_SIZE ((GLenum) 113)
|
||||
#define GLUT_WINDOW_ACCUM_ALPHA_SIZE ((GLenum) 114)
|
||||
#define GLUT_WINDOW_DOUBLEBUFFER ((GLenum) 115)
|
||||
#define GLUT_WINDOW_RGBA ((GLenum) 116)
|
||||
#define GLUT_WINDOW_PARENT ((GLenum) 117)
|
||||
#define GLUT_WINDOW_NUM_CHILDREN ((GLenum) 118)
|
||||
#define GLUT_WINDOW_COLORMAP_SIZE ((GLenum) 119)
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
#define GLUT_WINDOW_NUM_SAMPLES ((GLenum) 120)
|
||||
#define GLUT_WINDOW_STEREO ((GLenum) 121)
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
#define GLUT_WINDOW_CURSOR ((GLenum) 122)
|
||||
#endif
|
||||
#define GLUT_SCREEN_WIDTH ((GLenum) 200)
|
||||
#define GLUT_SCREEN_HEIGHT ((GLenum) 201)
|
||||
#define GLUT_SCREEN_WIDTH_MM ((GLenum) 202)
|
||||
#define GLUT_SCREEN_HEIGHT_MM ((GLenum) 203)
|
||||
#define GLUT_MENU_NUM_ITEMS ((GLenum) 300)
|
||||
#define GLUT_DISPLAY_MODE_POSSIBLE ((GLenum) 400)
|
||||
#define GLUT_INIT_WINDOW_X ((GLenum) 500)
|
||||
#define GLUT_INIT_WINDOW_Y ((GLenum) 501)
|
||||
#define GLUT_INIT_WINDOW_WIDTH ((GLenum) 502)
|
||||
#define GLUT_INIT_WINDOW_HEIGHT ((GLenum) 503)
|
||||
#define GLUT_INIT_DISPLAY_MODE ((GLenum) 504)
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
#define GLUT_ELAPSED_TIME ((GLenum) 700)
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||
#define GLUT_WINDOW_FORMAT_ID ((GLenum) 123)
|
||||
#endif
|
||||
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
/* glutDeviceGet parameters. */
|
||||
#define GLUT_HAS_KEYBOARD ((GLenum) 600)
|
||||
#define GLUT_HAS_MOUSE ((GLenum) 601)
|
||||
#define GLUT_HAS_SPACEBALL ((GLenum) 602)
|
||||
#define GLUT_HAS_DIAL_AND_BUTTON_BOX ((GLenum) 603)
|
||||
#define GLUT_HAS_TABLET ((GLenum) 604)
|
||||
#define GLUT_NUM_MOUSE_BUTTONS ((GLenum) 605)
|
||||
#define GLUT_NUM_SPACEBALL_BUTTONS ((GLenum) 606)
|
||||
#define GLUT_NUM_BUTTON_BOX_BUTTONS ((GLenum) 607)
|
||||
#define GLUT_NUM_DIALS ((GLenum) 608)
|
||||
#define GLUT_NUM_TABLET_BUTTONS ((GLenum) 609)
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||
#define GLUT_DEVICE_IGNORE_KEY_REPEAT ((GLenum) 610)
|
||||
#define GLUT_DEVICE_KEY_REPEAT ((GLenum) 611)
|
||||
#define GLUT_HAS_JOYSTICK ((GLenum) 612)
|
||||
#define GLUT_OWNS_JOYSTICK ((GLenum) 613)
|
||||
#define GLUT_JOYSTICK_BUTTONS ((GLenum) 614)
|
||||
#define GLUT_JOYSTICK_AXES ((GLenum) 615)
|
||||
#define GLUT_JOYSTICK_POLL_RATE ((GLenum) 616)
|
||||
#endif
|
||||
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
/* glutLayerGet parameters. */
|
||||
#define GLUT_OVERLAY_POSSIBLE ((GLenum) 800)
|
||||
#define GLUT_LAYER_IN_USE ((GLenum) 801)
|
||||
#define GLUT_HAS_OVERLAY ((GLenum) 802)
|
||||
#define GLUT_TRANSPARENT_INDEX ((GLenum) 803)
|
||||
#define GLUT_NORMAL_DAMAGED ((GLenum) 804)
|
||||
#define GLUT_OVERLAY_DAMAGED ((GLenum) 805)
|
||||
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
/* glutVideoResizeGet parameters. */
|
||||
#define GLUT_VIDEO_RESIZE_POSSIBLE ((GLenum) 900)
|
||||
#define GLUT_VIDEO_RESIZE_IN_USE ((GLenum) 901)
|
||||
#define GLUT_VIDEO_RESIZE_X_DELTA ((GLenum) 902)
|
||||
#define GLUT_VIDEO_RESIZE_Y_DELTA ((GLenum) 903)
|
||||
#define GLUT_VIDEO_RESIZE_WIDTH_DELTA ((GLenum) 904)
|
||||
#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA ((GLenum) 905)
|
||||
#define GLUT_VIDEO_RESIZE_X ((GLenum) 906)
|
||||
#define GLUT_VIDEO_RESIZE_Y ((GLenum) 907)
|
||||
#define GLUT_VIDEO_RESIZE_WIDTH ((GLenum) 908)
|
||||
#define GLUT_VIDEO_RESIZE_HEIGHT ((GLenum) 909)
|
||||
#endif
|
||||
|
||||
/* glutUseLayer parameters. */
|
||||
#define GLUT_NORMAL ((GLenum) 0)
|
||||
#define GLUT_OVERLAY ((GLenum) 1)
|
||||
|
||||
/* glutGetModifiers return mask. */
|
||||
#define GLUT_ACTIVE_SHIFT 1
|
||||
#define GLUT_ACTIVE_CTRL 2
|
||||
#define GLUT_ACTIVE_ALT 4
|
||||
|
||||
/* glutSetCursor parameters. */
|
||||
/* Basic arrows. */
|
||||
#define GLUT_CURSOR_RIGHT_ARROW 0
|
||||
#define GLUT_CURSOR_LEFT_ARROW 1
|
||||
/* Symbolic cursor shapes. */
|
||||
#define GLUT_CURSOR_INFO 2
|
||||
#define GLUT_CURSOR_DESTROY 3
|
||||
#define GLUT_CURSOR_HELP 4
|
||||
#define GLUT_CURSOR_CYCLE 5
|
||||
#define GLUT_CURSOR_SPRAY 6
|
||||
#define GLUT_CURSOR_WAIT 7
|
||||
#define GLUT_CURSOR_TEXT 8
|
||||
#define GLUT_CURSOR_CROSSHAIR 9
|
||||
/* Directional cursors. */
|
||||
#define GLUT_CURSOR_UP_DOWN 10
|
||||
#define GLUT_CURSOR_LEFT_RIGHT 11
|
||||
/* Sizing cursors. */
|
||||
#define GLUT_CURSOR_TOP_SIDE 12
|
||||
#define GLUT_CURSOR_BOTTOM_SIDE 13
|
||||
#define GLUT_CURSOR_LEFT_SIDE 14
|
||||
#define GLUT_CURSOR_RIGHT_SIDE 15
|
||||
#define GLUT_CURSOR_TOP_LEFT_CORNER 16
|
||||
#define GLUT_CURSOR_TOP_RIGHT_CORNER 17
|
||||
#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
|
||||
#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
|
||||
/* Inherit from parent window. */
|
||||
#define GLUT_CURSOR_INHERIT 100
|
||||
/* Blank cursor. */
|
||||
#define GLUT_CURSOR_NONE 101
|
||||
/* Fullscreen crosshair (if available). */
|
||||
#define GLUT_CURSOR_FULL_CROSSHAIR 102
|
||||
#endif
|
||||
|
||||
/* GLUT initialization sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv);
|
||||
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
|
||||
GLUTAPI void GLUTAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
|
||||
#ifndef GLUT_BUILDING_LIB
|
||||
static void GLUTAPIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
|
||||
#define glutInit glutInit_ATEXIT_HACK
|
||||
#endif
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutInitDisplayMode(unsigned int mode);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
GLUTAPI void GLUTAPIENTRY glutInitDisplayString(const char *string);
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutInitWindowPosition(int x, int y);
|
||||
GLUTAPI void GLUTAPIENTRY glutInitWindowSize(int width, int height);
|
||||
GLUTAPI void GLUTAPIENTRY glutMainLoop(void);
|
||||
|
||||
/* GLUT window sub-API. */
|
||||
GLUTAPI int GLUTAPIENTRY glutCreateWindow(const char *title);
|
||||
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
|
||||
GLUTAPI int GLUTAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
|
||||
#ifndef GLUT_BUILDING_LIB
|
||||
static int GLUTAPIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
|
||||
#define glutCreateWindow glutCreateWindow_ATEXIT_HACK
|
||||
#endif
|
||||
#endif
|
||||
GLUTAPI int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
|
||||
GLUTAPI void GLUTAPIENTRY glutDestroyWindow(int win);
|
||||
GLUTAPI void GLUTAPIENTRY glutPostRedisplay(void);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
|
||||
GLUTAPI void GLUTAPIENTRY glutPostWindowRedisplay(int win);
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutSwapBuffers(void);
|
||||
GLUTAPI int GLUTAPIENTRY glutGetWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetWindow(int win);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetWindowTitle(const char *title);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetIconTitle(const char *title);
|
||||
GLUTAPI void GLUTAPIENTRY glutPositionWindow(int x, int y);
|
||||
GLUTAPI void GLUTAPIENTRY glutReshapeWindow(int width, int height);
|
||||
GLUTAPI void GLUTAPIENTRY glutPopWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutPushWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutIconifyWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutShowWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutHideWindow(void);
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
GLUTAPI void GLUTAPIENTRY glutFullScreen(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetCursor(int cursor);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
GLUTAPI void GLUTAPIENTRY glutWarpPointer(int x, int y);
|
||||
#endif
|
||||
|
||||
/* GLUT overlay sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutEstablishOverlay(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutRemoveOverlay(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutUseLayer(GLenum layer);
|
||||
GLUTAPI void GLUTAPIENTRY glutPostOverlayRedisplay(void);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
|
||||
GLUTAPI void GLUTAPIENTRY glutPostWindowOverlayRedisplay(int win);
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutShowOverlay(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutHideOverlay(void);
|
||||
#endif
|
||||
|
||||
/* GLUT menu sub-API. */
|
||||
GLUTAPI int GLUTAPIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
|
||||
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
|
||||
GLUTAPI int GLUTAPIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
|
||||
#ifndef GLUT_BUILDING_LIB
|
||||
static int GLUTAPIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); }
|
||||
#define glutCreateMenu glutCreateMenu_ATEXIT_HACK
|
||||
#endif
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutDestroyMenu(int menu);
|
||||
GLUTAPI int GLUTAPIENTRY glutGetMenu(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetMenu(int menu);
|
||||
GLUTAPI void GLUTAPIENTRY glutAddMenuEntry(const char *label, int value);
|
||||
GLUTAPI void GLUTAPIENTRY glutAddSubMenu(const char *label, int submenu);
|
||||
GLUTAPI void GLUTAPIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
|
||||
GLUTAPI void GLUTAPIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
|
||||
GLUTAPI void GLUTAPIENTRY glutRemoveMenuItem(int item);
|
||||
GLUTAPI void GLUTAPIENTRY glutAttachMenu(int button);
|
||||
GLUTAPI void GLUTAPIENTRY glutDetachMenu(int button);
|
||||
|
||||
/* GLUT window callback sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
|
||||
GLUTAPI void GLUTAPIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height));
|
||||
GLUTAPI void GLUTAPIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state));
|
||||
GLUTAPI void GLUTAPIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state));
|
||||
GLUTAPI void GLUTAPIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void));
|
||||
GLUTAPI void GLUTAPIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value);
|
||||
GLUTAPI void GLUTAPIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state));
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
GLUTAPI void GLUTAPIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
|
||||
GLUTAPI void GLUTAPIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
|
||||
GLUTAPI void GLUTAPIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state));
|
||||
GLUTAPI void GLUTAPIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state));
|
||||
GLUTAPI void GLUTAPIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value));
|
||||
GLUTAPI void GLUTAPIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
GLUTAPI void GLUTAPIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void));
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
GLUTAPI void GLUTAPIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state));
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||
GLUTAPI void GLUTAPIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* GLUT color index sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
|
||||
GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component);
|
||||
GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win);
|
||||
|
||||
/* GLUT state retrieval sub-API. */
|
||||
GLUTAPI int GLUTAPIENTRY glutGet(GLenum type);
|
||||
GLUTAPI int GLUTAPIENTRY glutDeviceGet(GLenum type);
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
/* GLUT extension support sub-API */
|
||||
GLUTAPI int GLUTAPIENTRY glutExtensionSupported(const char *name);
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
GLUTAPI int GLUTAPIENTRY glutGetModifiers(void);
|
||||
GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type);
|
||||
#endif
|
||||
|
||||
/* GLUT font sub-API */
|
||||
GLUTAPI void GLUTAPIENTRY glutBitmapCharacter(void *font, int character);
|
||||
GLUTAPI int GLUTAPIENTRY glutBitmapWidth(void *font, int character);
|
||||
GLUTAPI void GLUTAPIENTRY glutStrokeCharacter(void *font, int character);
|
||||
GLUTAPI int GLUTAPIENTRY glutStrokeWidth(void *font, int character);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
GLUTAPI int GLUTAPIENTRY glutBitmapLength(void *font, const unsigned char *string);
|
||||
GLUTAPI int GLUTAPIENTRY glutStrokeLength(void *font, const unsigned char *string);
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 17)
|
||||
GLUTAPI float GLUTAPIENTRY glutStrokeWidthf(void *font, int character);
|
||||
GLUTAPI float GLUTAPIENTRY glutStrokeLengthf(void *font, const unsigned char *string);
|
||||
#endif
|
||||
|
||||
/* GLUT pre-built models sub-API */
|
||||
GLUTAPI void GLUTAPIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireCube(GLdouble size);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidCube(GLdouble size);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireDodecahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidDodecahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireTeapot(GLdouble size);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidTeapot(GLdouble size);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireOctahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidOctahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireTetrahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidTetrahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireIcosahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidIcosahedron(void);
|
||||
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
/* GLUT video resize sub-API. */
|
||||
GLUTAPI int GLUTAPIENTRY glutVideoResizeGet(GLenum param);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetupVideoResizing(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutStopVideoResizing(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutVideoResize(int x, int y, int width, int height);
|
||||
GLUTAPI void GLUTAPIENTRY glutVideoPan(int x, int y, int width, int height);
|
||||
|
||||
/* GLUT debugging sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutReportErrors(void);
|
||||
#endif
|
||||
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||
/* GLUT device control sub-API. */
|
||||
/* glutSetKeyRepeat modes. */
|
||||
#define GLUT_KEY_REPEAT_OFF 0
|
||||
#define GLUT_KEY_REPEAT_ON 1
|
||||
#define GLUT_KEY_REPEAT_DEFAULT 2
|
||||
|
||||
/* Joystick button masks. */
|
||||
#define GLUT_JOYSTICK_BUTTON_A 1
|
||||
#define GLUT_JOYSTICK_BUTTON_B 2
|
||||
#define GLUT_JOYSTICK_BUTTON_C 4
|
||||
#define GLUT_JOYSTICK_BUTTON_D 8
|
||||
|
||||
GLUTAPI void GLUTAPIENTRY glutIgnoreKeyRepeat(int ignore);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetKeyRepeat(int repeatMode);
|
||||
GLUTAPI void GLUTAPIENTRY glutForceJoystickFunc(void);
|
||||
|
||||
/* GLUT game mode sub-API. */
|
||||
/* glutGameModeGet. */
|
||||
#define GLUT_GAME_MODE_ACTIVE ((GLenum) 0)
|
||||
#define GLUT_GAME_MODE_POSSIBLE ((GLenum) 1)
|
||||
#define GLUT_GAME_MODE_WIDTH ((GLenum) 2)
|
||||
#define GLUT_GAME_MODE_HEIGHT ((GLenum) 3)
|
||||
#define GLUT_GAME_MODE_PIXEL_DEPTH ((GLenum) 4)
|
||||
#define GLUT_GAME_MODE_REFRESH_RATE ((GLenum) 5)
|
||||
#define GLUT_GAME_MODE_DISPLAY_CHANGED ((GLenum) 6)
|
||||
|
||||
GLUTAPI void GLUTAPIENTRY glutGameModeString(const char *string);
|
||||
GLUTAPI int GLUTAPIENTRY glutEnterGameMode(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutLeaveGameMode(void);
|
||||
GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef GLUT_APIENTRY_DEFINED
|
||||
# undef GLUT_APIENTRY_DEFINED
|
||||
# undef APIENTRY
|
||||
#endif
|
||||
|
||||
#ifdef GLUT_WINGDIAPI_DEFINED
|
||||
# undef GLUT_WINGDIAPI_DEFINED
|
||||
# undef WINGDIAPI
|
||||
#endif
|
||||
|
||||
#ifdef GLUT_DEFINED___CDECL
|
||||
# undef GLUT_DEFINED___CDECL
|
||||
# undef __cdecl
|
||||
#endif
|
||||
|
||||
#ifdef GLUT_DEFINED__CRTIMP
|
||||
# undef GLUT_DEFINED__CRTIMP
|
||||
# undef _CRTIMP
|
||||
#endif
|
||||
|
||||
#endif /* __glut_h__ */
|
||||
610
documents/Tesselation_Tutorial/ext/GL/glxext.h
Normal file
610
documents/Tesselation_Tutorial/ext/GL/glxext.h
Normal file
@@ -0,0 +1,610 @@
|
||||
#ifndef __glxext_h_
|
||||
#define __glxext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** Original Code. The Original Code is: OpenGL Sample Implementation,
|
||||
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
||||
** Inc. The Original Code is Copyright (c) 1991-2002 Silicon Graphics, Inc.
|
||||
** Copyright in any portions created by third parties is as indicated
|
||||
** elsewhere herein. All Rights Reserved.
|
||||
**
|
||||
** Additional Notice Provisions: This software was created using the
|
||||
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
|
||||
** not been independently verified as being compliant with the OpenGL(R)
|
||||
** version 1.2.1 Specification.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#ifndef APIENTRYP
|
||||
#define APIENTRYP APIENTRY *
|
||||
#endif
|
||||
#ifndef GLAPI
|
||||
#define GLAPI extern
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glxext.h last updated 2002/03/22 */
|
||||
/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
|
||||
#define GLX_GLXEXT_VERSION 5
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_WINDOW_BIT 0x00000001
|
||||
#define GLX_PIXMAP_BIT 0x00000002
|
||||
#define GLX_PBUFFER_BIT 0x00000004
|
||||
#define GLX_RGBA_BIT 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT 0x00000002
|
||||
#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
|
||||
#define GLX_AUX_BUFFERS_BIT 0x00000010
|
||||
#define GLX_DEPTH_BUFFER_BIT 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT 0x00000080
|
||||
#define GLX_CONFIG_CAVEAT 0x20
|
||||
#define GLX_X_VISUAL_TYPE 0x22
|
||||
#define GLX_TRANSPARENT_TYPE 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
|
||||
#define GLX_DONT_CARE 0xFFFFFFFF
|
||||
#define GLX_NONE 0x8000
|
||||
#define GLX_SLOW_CONFIG 0x8001
|
||||
#define GLX_TRUE_COLOR 0x8002
|
||||
#define GLX_DIRECT_COLOR 0x8003
|
||||
#define GLX_PSEUDO_COLOR 0x8004
|
||||
#define GLX_STATIC_COLOR 0x8005
|
||||
#define GLX_GRAY_SCALE 0x8006
|
||||
#define GLX_STATIC_GRAY 0x8007
|
||||
#define GLX_TRANSPARENT_RGB 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX 0x8009
|
||||
#define GLX_VISUAL_ID 0x800B
|
||||
#define GLX_SCREEN 0x800C
|
||||
#define GLX_NON_CONFORMANT_CONFIG 0x800D
|
||||
#define GLX_DRAWABLE_TYPE 0x8010
|
||||
#define GLX_RENDER_TYPE 0x8011
|
||||
#define GLX_X_RENDERABLE 0x8012
|
||||
#define GLX_FBCONFIG_ID 0x8013
|
||||
#define GLX_RGBA_TYPE 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE 0x8015
|
||||
#define GLX_MAX_PBUFFER_WIDTH 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS 0x8018
|
||||
#define GLX_PRESERVED_CONTENTS 0x801B
|
||||
#define GLX_LARGEST_PBUFFER 0x801C
|
||||
#define GLX_WIDTH 0x801D
|
||||
#define GLX_HEIGHT 0x801E
|
||||
#define GLX_EVENT_MASK 0x801F
|
||||
#define GLX_DAMAGED 0x8020
|
||||
#define GLX_SAVED 0x8021
|
||||
#define GLX_WINDOW 0x8022
|
||||
#define GLX_PBUFFER 0x8023
|
||||
#define GLX_PBUFFER_HEIGHT 0x8040
|
||||
#define GLX_PBUFFER_WIDTH 0x8041
|
||||
#endif
|
||||
|
||||
#ifndef GLX_VERSION_1_4
|
||||
#define GLX_SAMPLE_BUFFERS 100000
|
||||
#define GLX_SAMPLES 100001
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_multisample
|
||||
#define GLX_SAMPLE_BUFFERS_ARB 100000
|
||||
#define GLX_SAMPLES_ARB 100001
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_multisample
|
||||
#define GLX_SAMPLE_BUFFERS_SGIS 100000
|
||||
#define GLX_SAMPLES_SGIS 100001
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_visual_info
|
||||
#define GLX_X_VISUAL_TYPE_EXT 0x22
|
||||
#define GLX_TRANSPARENT_TYPE_EXT 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
|
||||
#define GLX_NONE_EXT 0x8000
|
||||
#define GLX_TRUE_COLOR_EXT 0x8002
|
||||
#define GLX_DIRECT_COLOR_EXT 0x8003
|
||||
#define GLX_PSEUDO_COLOR_EXT 0x8004
|
||||
#define GLX_STATIC_COLOR_EXT 0x8005
|
||||
#define GLX_GRAY_SCALE_EXT 0x8006
|
||||
#define GLX_STATIC_GRAY_EXT 0x8007
|
||||
#define GLX_TRANSPARENT_RGB_EXT 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX_EXT 0x8009
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_swap_control
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_video_sync
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_make_current_read
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_source
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_visual_rating
|
||||
#define GLX_VISUAL_CAVEAT_EXT 0x20
|
||||
#define GLX_SLOW_VISUAL_EXT 0x8001
|
||||
#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
|
||||
/* reuse GLX_NONE_EXT */
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_import_context
|
||||
#define GLX_SHARE_CONTEXT_EXT 0x800A
|
||||
#define GLX_VISUAL_ID_EXT 0x800B
|
||||
#define GLX_SCREEN_EXT 0x800C
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
#define GLX_WINDOW_BIT_SGIX 0x00000001
|
||||
#define GLX_PIXMAP_BIT_SGIX 0x00000002
|
||||
#define GLX_RGBA_BIT_SGIX 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
|
||||
#define GLX_DRAWABLE_TYPE_SGIX 0x8010
|
||||
#define GLX_RENDER_TYPE_SGIX 0x8011
|
||||
#define GLX_X_RENDERABLE_SGIX 0x8012
|
||||
#define GLX_FBCONFIG_ID_SGIX 0x8013
|
||||
#define GLX_RGBA_TYPE_SGIX 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
|
||||
/* reuse GLX_SCREEN_EXT */
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_pbuffer
|
||||
#define GLX_PBUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
|
||||
#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
|
||||
#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
|
||||
#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
|
||||
#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
|
||||
#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
|
||||
#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
|
||||
#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
|
||||
#define GLX_LARGEST_PBUFFER_SGIX 0x801C
|
||||
#define GLX_WIDTH_SGIX 0x801D
|
||||
#define GLX_HEIGHT_SGIX 0x801E
|
||||
#define GLX_EVENT_MASK_SGIX 0x801F
|
||||
#define GLX_DAMAGED_SGIX 0x8020
|
||||
#define GLX_SAVED_SGIX 0x8021
|
||||
#define GLX_WINDOW_SGIX 0x8022
|
||||
#define GLX_PBUFFER_SGIX 0x8023
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_cushion
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_resize
|
||||
#define GLX_SYNC_FRAME_SGIX 0x00000000
|
||||
#define GLX_SYNC_SWAP_SGIX 0x00000001
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_dmbuffer
|
||||
#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_swap_group
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_swap_barrier
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_blended_overlay
|
||||
#define GLX_BLENDED_RGBA_SGIS 0x8025
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_shared_multisample
|
||||
#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
|
||||
#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SUN_get_transparent_index
|
||||
#endif
|
||||
|
||||
#ifndef GLX_3DFX_multisample
|
||||
#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
|
||||
#define GLX_SAMPLES_3DFX 0x8051
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_copy_sub_buffer
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_pixmap_colormap
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_release_buffers
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_set_3dfx_mode
|
||||
#define GLX_3DFX_WINDOW_MODE_MESA 0x1
|
||||
#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_visual_select_group
|
||||
#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
|
||||
#endif
|
||||
|
||||
#ifndef GLX_OML_swap_method
|
||||
#define GLX_SWAP_METHOD_OML 0x8060
|
||||
#define GLX_SWAP_EXCHANGE_OML 0x8061
|
||||
#define GLX_SWAP_COPY_OML 0x8062
|
||||
#define GLX_SWAP_UNDEFINED_OML 0x8063
|
||||
#endif
|
||||
|
||||
#ifndef GLX_OML_sync_control
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
typedef void (*__GLXextFuncPtr)(void);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_source
|
||||
typedef XID GLXVideoSourceSGIX;
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
typedef XID GLXFBConfigIDSGIX;
|
||||
typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_pbuffer
|
||||
typedef XID GLXPbufferSGIX;
|
||||
typedef struct {
|
||||
int type;
|
||||
unsigned long serial; /* # of last request processed by server */
|
||||
Bool send_event; /* true if this came for SendEvent request */
|
||||
Display *display; /* display the event was read from */
|
||||
GLXDrawable drawable; /* i.d. of Drawable */
|
||||
int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
|
||||
int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
|
||||
unsigned int mask; /* mask indicating which buffers are affected*/
|
||||
int x, y;
|
||||
int width, height;
|
||||
int count; /* if nonzero, at least this many more */
|
||||
} GLXBufferClobberEventSGIX;
|
||||
#endif
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_VERSION_1_3 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXFBConfig * glXGetFBConfigs (Display *, int, int *);
|
||||
extern GLXFBConfig * glXChooseFBConfig (Display *, int, const int *, int *);
|
||||
extern int glXGetFBConfigAttrib (Display *, GLXFBConfig, int, int *);
|
||||
extern XVisualInfo * glXGetVisualFromFBConfig (Display *, GLXFBConfig);
|
||||
extern GLXWindow glXCreateWindow (Display *, GLXFBConfig, Window, const int *);
|
||||
extern void glXDestroyWindow (Display *, GLXWindow);
|
||||
extern GLXPixmap glXCreatePixmap (Display *, GLXFBConfig, Pixmap, const int *);
|
||||
extern void glXDestroyPixmap (Display *, GLXPixmap);
|
||||
extern GLXPbuffer glXCreatePbuffer (Display *, GLXFBConfig, const int *);
|
||||
extern void glXDestroyPbuffer (Display *, GLXPbuffer);
|
||||
extern void glXQueryDrawable (Display *, GLXDrawable, int, unsigned int *);
|
||||
extern GLXContext glXCreateNewContext (Display *, GLXFBConfig, int, GLXContext, Bool);
|
||||
extern Bool glXMakeContextCurrent (Display *, GLXDrawable, GLXDrawable, GLXContext);
|
||||
extern GLXDrawable glXGetCurrentReadDrawable (void);
|
||||
extern Display * glXGetCurrentDisplay (void);
|
||||
extern int glXQueryContext (Display *, GLXContext, int, int *);
|
||||
extern void glXSelectEvent (Display *, GLXDrawable, unsigned long);
|
||||
extern void glXGetSelectedEvent (Display *, GLXDrawable, unsigned long *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXFBConfig * ( PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef GLXFBConfig * ( PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
|
||||
typedef int ( PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
|
||||
typedef XVisualInfo * ( PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
|
||||
typedef GLXWindow ( PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
|
||||
typedef void ( PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
|
||||
typedef GLXPixmap ( PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
|
||||
typedef void ( PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
|
||||
typedef GLXPbuffer ( PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
|
||||
typedef void ( PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
|
||||
typedef void ( PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
|
||||
typedef GLXContext ( PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef Bool ( PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable ( PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
|
||||
typedef Display * ( PFNGLXGETCURRENTDISPLAYPROC) (void);
|
||||
typedef int ( PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
|
||||
typedef void ( PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
|
||||
typedef void ( PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_VERSION_1_4
|
||||
#define GLX_VERSION_1_4 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef __GLXextFuncPtr ( PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
#define GLX_ARB_get_proc_address 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef __GLXextFuncPtr ( PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_multisample
|
||||
#define GLX_ARB_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_multisample
|
||||
#define GLX_SGIS_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_visual_info
|
||||
#define GLX_EXT_visual_info 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_swap_control
|
||||
#define GLX_SGI_swap_control 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXSwapIntervalSGI (int);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( PFNGLXSWAPINTERVALSGIPROC) (int interval);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_video_sync
|
||||
#define GLX_SGI_video_sync 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXGetVideoSyncSGI (unsigned int *);
|
||||
extern int glXWaitVideoSyncSGI (int, int, unsigned int *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
|
||||
typedef int ( PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_make_current_read
|
||||
#define GLX_SGI_make_current_read 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXMakeCurrentReadSGI (Display *, GLXDrawable, GLXDrawable, GLXContext);
|
||||
extern GLXDrawable glXGetCurrentReadDrawableSGI (void);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable ( PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_source
|
||||
#define GLX_SGIX_video_source 1
|
||||
#ifdef _VL_H
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode);
|
||||
extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXVideoSourceSGIX ( PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
|
||||
typedef void ( PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
|
||||
#endif
|
||||
|
||||
#endif /* _VL_H */
|
||||
#ifndef GLX_EXT_visual_rating
|
||||
#define GLX_EXT_visual_rating 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_import_context
|
||||
#define GLX_EXT_import_context 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Display * glXGetCurrentDisplayEXT (void);
|
||||
extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *);
|
||||
extern GLXContextID glXGetContextIDEXT (const GLXContext);
|
||||
extern GLXContext glXImportContextEXT (Display *, GLXContextID);
|
||||
extern void glXFreeContextEXT (Display *, GLXContext);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Display * ( PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
|
||||
typedef int ( PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
|
||||
typedef GLXContextID ( PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
|
||||
typedef GLXContext ( PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
|
||||
typedef void ( PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
#define GLX_SGIX_fbconfig 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXGetFBConfigAttribSGIX (Display *, GLXFBConfigSGIX, int, int *);
|
||||
extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *, int, int *, int *);
|
||||
extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *, GLXFBConfigSGIX, Pixmap);
|
||||
extern GLXContext glXCreateContextWithConfigSGIX (Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
|
||||
extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *, GLXFBConfigSGIX);
|
||||
extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *, XVisualInfo *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
|
||||
typedef GLXFBConfigSGIX * ( PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
|
||||
typedef GLXPixmap ( PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
|
||||
typedef GLXContext ( PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef XVisualInfo * ( PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
|
||||
typedef GLXFBConfigSGIX ( PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_pbuffer
|
||||
#define GLX_SGIX_pbuffer 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
|
||||
extern void glXDestroyGLXPbufferSGIX (Display *, GLXPbufferSGIX);
|
||||
extern int glXQueryGLXPbufferSGIX (Display *, GLXPbufferSGIX, int, unsigned int *);
|
||||
extern void glXSelectEventSGIX (Display *, GLXDrawable, unsigned long);
|
||||
extern void glXGetSelectedEventSGIX (Display *, GLXDrawable, unsigned long *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXPbufferSGIX ( PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
|
||||
typedef void ( PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
|
||||
typedef int ( PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
|
||||
typedef void ( PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
|
||||
typedef void ( PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_cushion
|
||||
#define GLX_SGI_cushion 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXCushionSGI (Display *, Window, float);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_resize
|
||||
#define GLX_SGIX_video_resize 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXBindChannelToWindowSGIX (Display *, int, int, Window);
|
||||
extern int glXChannelRectSGIX (Display *, int, int, int, int, int, int);
|
||||
extern int glXQueryChannelRectSGIX (Display *, int, int, int *, int *, int *, int *);
|
||||
extern int glXQueryChannelDeltasSGIX (Display *, int, int, int *, int *, int *, int *);
|
||||
extern int glXChannelRectSyncSGIX (Display *, int, int, GLenum);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
|
||||
typedef int ( PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
|
||||
typedef int ( PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
|
||||
typedef int ( PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
|
||||
typedef int ( PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_dmbuffer
|
||||
#define GLX_SGIX_dmbuffer 1
|
||||
#ifdef _DM_BUFFER_H_
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
|
||||
#endif
|
||||
|
||||
#endif /* _DM_BUFFER_H_ */
|
||||
#ifndef GLX_SGIX_swap_group
|
||||
#define GLX_SGIX_swap_group 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_swap_barrier
|
||||
#define GLX_SGIX_swap_barrier 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXBindSwapBarrierSGIX (Display *, GLXDrawable, int);
|
||||
extern Bool glXQueryMaxSwapBarriersSGIX (Display *, int, int *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
|
||||
typedef Bool ( PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SUN_get_transparent_index
|
||||
#define GLX_SUN_get_transparent_index 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Status ( PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_copy_sub_buffer
|
||||
#define GLX_MESA_copy_sub_buffer 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXCopySubBufferMESA (Display *, GLXDrawable, int, int, int, int);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_pixmap_colormap
|
||||
#define GLX_MESA_pixmap_colormap 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXPixmap glXCreateGLXPixmapMESA (Display *, XVisualInfo *, Pixmap, Colormap);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXPixmap ( PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_release_buffers
|
||||
#define GLX_MESA_release_buffers 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXReleaseBuffersMESA (Display *, GLXDrawable);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_set_3dfx_mode
|
||||
#define GLX_MESA_set_3dfx_mode 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXSet3DfxModeMESA (int);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( PFNGLXSET3DFXMODEMESAPROC) (int mode);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_visual_select_group
|
||||
#define GLX_SGIX_visual_select_group 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_OML_swap_method
|
||||
#define GLX_OML_swap_method 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_OML_sync_control
|
||||
#define GLX_OML_sync_control 1
|
||||
#if defined(__STDC_VERSION__)
|
||||
#if __STDC_VERSION__ >= 199901L
|
||||
/* Include ISO C99 integer types for OML_sync_control; need a better test */
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *);
|
||||
extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *);
|
||||
extern int64_t glXSwapBuffersMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t);
|
||||
extern Bool glXWaitForMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *);
|
||||
extern Bool glXWaitForSbcOML (Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
typedef Bool ( PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
|
||||
typedef int64_t ( PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
|
||||
typedef Bool ( PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
typedef Bool ( PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
#endif
|
||||
|
||||
#endif /* C99 version test */
|
||||
#endif /* STDC test */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
631
documents/Tesselation_Tutorial/ext/GL/wglext.h
Normal file
631
documents/Tesselation_Tutorial/ext/GL/wglext.h
Normal file
@@ -0,0 +1,631 @@
|
||||
#ifndef __wglext_h_
|
||||
#define __wglext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** Original Code. The Original Code is: OpenGL Sample Implementation,
|
||||
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
||||
** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
|
||||
** Copyright in any portions created by third parties is as indicated
|
||||
** elsewhere herein. All Rights Reserved.
|
||||
**
|
||||
** Additional Notice Provisions: This software was created using the
|
||||
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
|
||||
** not been independently verified as being compliant with the OpenGL(R)
|
||||
** version 1.2.1 Specification.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#ifndef APIENTRYP
|
||||
#define APIENTRYP APIENTRY *
|
||||
#endif
|
||||
#ifndef GLAPI
|
||||
#define GLAPI extern
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number */
|
||||
/* wglext.h last updated 2005/01/07 */
|
||||
/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
|
||||
#define WGL_WGLEXT_VERSION 6
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
|
||||
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
|
||||
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
|
||||
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
|
||||
#define WGL_SAMPLES_ARB 0x2042
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
|
||||
#define WGL_ACCELERATION_ARB 0x2003
|
||||
#define WGL_NEED_PALETTE_ARB 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
|
||||
#define WGL_SWAP_METHOD_ARB 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
|
||||
#define WGL_TRANSPARENT_ARB 0x200A
|
||||
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
|
||||
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
|
||||
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
|
||||
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
|
||||
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
|
||||
#define WGL_SHARE_DEPTH_ARB 0x200C
|
||||
#define WGL_SHARE_STENCIL_ARB 0x200D
|
||||
#define WGL_SHARE_ACCUM_ARB 0x200E
|
||||
#define WGL_SUPPORT_GDI_ARB 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_ARB 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_ARB 0x2011
|
||||
#define WGL_STEREO_ARB 0x2012
|
||||
#define WGL_PIXEL_TYPE_ARB 0x2013
|
||||
#define WGL_COLOR_BITS_ARB 0x2014
|
||||
#define WGL_RED_BITS_ARB 0x2015
|
||||
#define WGL_RED_SHIFT_ARB 0x2016
|
||||
#define WGL_GREEN_BITS_ARB 0x2017
|
||||
#define WGL_GREEN_SHIFT_ARB 0x2018
|
||||
#define WGL_BLUE_BITS_ARB 0x2019
|
||||
#define WGL_BLUE_SHIFT_ARB 0x201A
|
||||
#define WGL_ALPHA_BITS_ARB 0x201B
|
||||
#define WGL_ALPHA_SHIFT_ARB 0x201C
|
||||
#define WGL_ACCUM_BITS_ARB 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_ARB 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
|
||||
#define WGL_DEPTH_BITS_ARB 0x2022
|
||||
#define WGL_STENCIL_BITS_ARB 0x2023
|
||||
#define WGL_AUX_BUFFERS_ARB 0x2024
|
||||
#define WGL_NO_ACCELERATION_ARB 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
|
||||
#define WGL_FULL_ACCELERATION_ARB 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_ARB 0x2028
|
||||
#define WGL_SWAP_COPY_ARB 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_ARB 0x202A
|
||||
#define WGL_TYPE_RGBA_ARB 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_ARB 0x202C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
|
||||
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
|
||||
#define WGL_PBUFFER_LARGEST_ARB 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_ARB 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
|
||||
#define WGL_PBUFFER_LOST_ARB 0x2036
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
|
||||
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
|
||||
#define WGL_TEXTURE_FORMAT_ARB 0x2072
|
||||
#define WGL_TEXTURE_TARGET_ARB 0x2073
|
||||
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
|
||||
#define WGL_TEXTURE_RGB_ARB 0x2075
|
||||
#define WGL_TEXTURE_RGBA_ARB 0x2076
|
||||
#define WGL_NO_TEXTURE_ARB 0x2077
|
||||
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
|
||||
#define WGL_TEXTURE_1D_ARB 0x2079
|
||||
#define WGL_TEXTURE_2D_ARB 0x207A
|
||||
#define WGL_MIPMAP_LEVEL_ARB 0x207B
|
||||
#define WGL_CUBE_MAP_FACE_ARB 0x207C
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
|
||||
#define WGL_FRONT_LEFT_ARB 0x2083
|
||||
#define WGL_FRONT_RIGHT_ARB 0x2084
|
||||
#define WGL_BACK_LEFT_ARB 0x2085
|
||||
#define WGL_BACK_RIGHT_ARB 0x2086
|
||||
#define WGL_AUX0_ARB 0x2087
|
||||
#define WGL_AUX1_ARB 0x2088
|
||||
#define WGL_AUX2_ARB 0x2089
|
||||
#define WGL_AUX3_ARB 0x208A
|
||||
#define WGL_AUX4_ARB 0x208B
|
||||
#define WGL_AUX5_ARB 0x208C
|
||||
#define WGL_AUX6_ARB 0x208D
|
||||
#define WGL_AUX7_ARB 0x208E
|
||||
#define WGL_AUX8_ARB 0x208F
|
||||
#define WGL_AUX9_ARB 0x2090
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format_float
|
||||
#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
|
||||
#define WGL_ACCELERATION_EXT 0x2003
|
||||
#define WGL_NEED_PALETTE_EXT 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
|
||||
#define WGL_SWAP_METHOD_EXT 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
|
||||
#define WGL_TRANSPARENT_EXT 0x200A
|
||||
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
|
||||
#define WGL_SHARE_DEPTH_EXT 0x200C
|
||||
#define WGL_SHARE_STENCIL_EXT 0x200D
|
||||
#define WGL_SHARE_ACCUM_EXT 0x200E
|
||||
#define WGL_SUPPORT_GDI_EXT 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_EXT 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_EXT 0x2011
|
||||
#define WGL_STEREO_EXT 0x2012
|
||||
#define WGL_PIXEL_TYPE_EXT 0x2013
|
||||
#define WGL_COLOR_BITS_EXT 0x2014
|
||||
#define WGL_RED_BITS_EXT 0x2015
|
||||
#define WGL_RED_SHIFT_EXT 0x2016
|
||||
#define WGL_GREEN_BITS_EXT 0x2017
|
||||
#define WGL_GREEN_SHIFT_EXT 0x2018
|
||||
#define WGL_BLUE_BITS_EXT 0x2019
|
||||
#define WGL_BLUE_SHIFT_EXT 0x201A
|
||||
#define WGL_ALPHA_BITS_EXT 0x201B
|
||||
#define WGL_ALPHA_SHIFT_EXT 0x201C
|
||||
#define WGL_ACCUM_BITS_EXT 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_EXT 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
|
||||
#define WGL_DEPTH_BITS_EXT 0x2022
|
||||
#define WGL_STENCIL_BITS_EXT 0x2023
|
||||
#define WGL_AUX_BUFFERS_EXT 0x2024
|
||||
#define WGL_NO_ACCELERATION_EXT 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
|
||||
#define WGL_FULL_ACCELERATION_EXT 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_EXT 0x2028
|
||||
#define WGL_SWAP_COPY_EXT 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_EXT 0x202A
|
||||
#define WGL_TYPE_RGBA_EXT 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_EXT 0x202C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
|
||||
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
|
||||
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
|
||||
#define WGL_PBUFFER_LARGEST_EXT 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_EXT 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_DEPTH_FLOAT_EXT 0x2040
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
|
||||
#define WGL_SAMPLES_3DFX 0x2061
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
|
||||
#define WGL_SAMPLES_EXT 0x2042
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
|
||||
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
|
||||
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
|
||||
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_render_depth_texture
|
||||
#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
|
||||
#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
|
||||
#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
|
||||
#define WGL_DEPTH_COMPONENT_NV 0x20A7
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_render_texture_rectangle
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
|
||||
#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ATI_pixel_format_float
|
||||
#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_float_buffer
|
||||
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
|
||||
#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
|
||||
#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
|
||||
#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
|
||||
#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
DECLARE_HANDLE(HPBUFFERARB);
|
||||
#endif
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
DECLARE_HANDLE(HPBUFFEREXT);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_ARB_buffer_region 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HANDLE WINAPI wglCreateBufferRegionARB (HDC, int, UINT);
|
||||
extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE);
|
||||
extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE, int, int, int, int);
|
||||
extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE, int, int, int, int, int, int);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
|
||||
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
|
||||
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
|
||||
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_ARB_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#define WGL_ARB_extensions_string 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern const char * WINAPI wglGetExtensionsStringARB (HDC);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_ARB_pixel_format 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC, int, int, UINT, const int *, int *);
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC, int, int, UINT, const int *, FLOAT *);
|
||||
extern BOOL WINAPI wglChoosePixelFormatARB (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define WGL_ARB_make_current_read 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglMakeContextCurrentARB (HDC, HDC, HGLRC);
|
||||
extern HDC WINAPI wglGetCurrentReadDCARB (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_ARB_pbuffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC, int, int, int, const int *);
|
||||
extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB);
|
||||
extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB, HDC);
|
||||
extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB);
|
||||
extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB, int, int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_ARB_render_texture 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB, int);
|
||||
extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB, int);
|
||||
extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB, const int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format_float
|
||||
#define WGL_ARB_pixel_format_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_display_color_table
|
||||
#define WGL_EXT_display_color_table 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort);
|
||||
extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *, GLuint);
|
||||
extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort);
|
||||
extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
|
||||
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_extensions_string
|
||||
#define WGL_EXT_extensions_string 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern const char * WINAPI wglGetExtensionsStringEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define WGL_EXT_make_current_read 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglMakeContextCurrentEXT (HDC, HDC, HGLRC);
|
||||
extern HDC WINAPI wglGetCurrentReadDCEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_EXT_pbuffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC, int, int, int, const int *);
|
||||
extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT);
|
||||
extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT, HDC);
|
||||
extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT);
|
||||
extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT, int, int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_EXT_pixel_format 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC, int, int, UINT, int *, int *);
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC, int, int, UINT, int *, FLOAT *);
|
||||
extern BOOL WINAPI wglChoosePixelFormatEXT (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_swap_control
|
||||
#define WGL_EXT_swap_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglSwapIntervalEXT (int);
|
||||
extern int WINAPI wglGetSwapIntervalEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
|
||||
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_EXT_depth_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_vertex_array_range
|
||||
#define WGL_NV_vertex_array_range 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern void* WINAPI wglAllocateMemoryNV (GLsizei, GLfloat, GLfloat, GLfloat);
|
||||
extern void WINAPI wglFreeMemoryNV (void *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_3DFX_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_EXT_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_OML_sync_control
|
||||
#define WGL_OML_sync_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetSyncValuesOML (HDC, INT64 *, INT64 *, INT64 *);
|
||||
extern BOOL WINAPI wglGetMscRateOML (HDC, INT32 *, INT32 *);
|
||||
extern INT64 WINAPI wglSwapBuffersMscOML (HDC, INT64, INT64, INT64);
|
||||
extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC, int, INT64, INT64, INT64);
|
||||
extern BOOL WINAPI wglWaitForMscOML (HDC, INT64, INT64, INT64, INT64 *, INT64 *, INT64 *);
|
||||
extern BOOL WINAPI wglWaitForSbcOML (HDC, INT64, INT64 *, INT64 *, INT64 *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_I3D_digital_video_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC, int, int *);
|
||||
extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC, int, const int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_I3D_gamma 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC, int, int *);
|
||||
extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC, int, const int *);
|
||||
extern BOOL WINAPI wglGetGammaTableI3D (HDC, int, USHORT *, USHORT *, USHORT *);
|
||||
extern BOOL WINAPI wglSetGammaTableI3D (HDC, int, const USHORT *, const USHORT *, const USHORT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_I3D_genlock 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnableGenlockI3D (HDC);
|
||||
extern BOOL WINAPI wglDisableGenlockI3D (HDC);
|
||||
extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC, BOOL *);
|
||||
extern BOOL WINAPI wglGenlockSourceI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSourceI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglGenlockSampleRateI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC, UINT *, UINT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_I3D_image_buffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern LPVOID WINAPI wglCreateImageBufferI3D (HDC, DWORD, UINT);
|
||||
extern BOOL WINAPI wglDestroyImageBufferI3D (HDC, LPVOID);
|
||||
extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC, const HANDLE *, const LPVOID *, const DWORD *, UINT);
|
||||
extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC, const LPVOID *, UINT);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
|
||||
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#define WGL_I3D_swap_frame_lock 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnableFrameLockI3D (void);
|
||||
extern BOOL WINAPI wglDisableFrameLockI3D (void);
|
||||
extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *);
|
||||
extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_usage
|
||||
#define WGL_I3D_swap_frame_usage 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetFrameUsageI3D (float *);
|
||||
extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
|
||||
extern BOOL WINAPI wglEndFrameTrackingI3D (void);
|
||||
extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *, DWORD *, float *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
|
||||
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ATI_pixel_format_float
|
||||
#define WGL_ATI_pixel_format_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_float_buffer
|
||||
#define WGL_NV_float_buffer 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
14599
documents/Tesselation_Tutorial/ext/glew.cpp
Normal file
14599
documents/Tesselation_Tutorial/ext/glew.cpp
Normal file
File diff suppressed because it is too large
Load Diff
14703
documents/Tesselation_Tutorial/ext/glew.h
Normal file
14703
documents/Tesselation_Tutorial/ext/glew.h
Normal file
File diff suppressed because it is too large
Load Diff
906
documents/Tesselation_Tutorial/ext/glsl.cpp
Normal file
906
documents/Tesselation_Tutorial/ext/glsl.cpp
Normal file
@@ -0,0 +1,906 @@
|
||||
/********************************************************************
|
||||
aGLSL.cpp
|
||||
Version: 0.9.4 - For OpenGL 2.0
|
||||
|
||||
License: BSD
|
||||
(c) 2003-2005 by Martin Christen. All Rights reserved.
|
||||
*********************************************************************/
|
||||
|
||||
#include "glsl.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Error, Warning and Info Strings
|
||||
char* aGLSLStrings[] = {
|
||||
"[e00] GLSL is not available!",
|
||||
"[e01] Not a valid program object!",
|
||||
"[e02] Not a valid object!",
|
||||
"[e03] Out of memory!",
|
||||
"[e04] Unknown compiler error!",
|
||||
"[e05] Linker log is not available!",
|
||||
"[e06] Compiler log is not available!",
|
||||
"[Empty]"
|
||||
};
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// GL ERROR CHECK
|
||||
int CheckGLError(char *file, int line)
|
||||
{
|
||||
//return 0;
|
||||
GLenum glErr,glErr2;
|
||||
int retCode = 0;
|
||||
|
||||
glErr = glErr2 = glGetError();
|
||||
while (glErr != GL_NO_ERROR)
|
||||
{
|
||||
char* str1 = (char*)gluErrorString(glErr);
|
||||
if (str1)
|
||||
cout << "GL Error #" << glErr << "(" << str1 << ") " << " in File " << file << " at line: " << line << endl;
|
||||
else
|
||||
cout << "GL Error #" << glErr << " in File " << file << " at line: " << line << endl;
|
||||
retCode = 1;
|
||||
glErr = glGetError();
|
||||
}
|
||||
if (glErr2 != GL_NO_ERROR) while(1)Sleep(100);;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// ************************************************************************
|
||||
// Implementation of glShader class
|
||||
// ************************************************************************
|
||||
|
||||
glShader::glShader()
|
||||
{
|
||||
ProgramObject = 0;
|
||||
linker_log = 0;
|
||||
is_linked = false;
|
||||
enabled = false;
|
||||
_mM = false;
|
||||
_noshader = true;
|
||||
|
||||
ProgramObject = glCreateProgram();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
glShader::~glShader()
|
||||
{
|
||||
if (linker_log!=0) free(linker_log);
|
||||
|
||||
for (unsigned int i=0;i<ShaderList.size();i++)
|
||||
{
|
||||
glDetachShader(ProgramObject, ShaderList[i]->ShaderObject);
|
||||
CHECK_GL_ERROR(); // if you get an error here, you deleted the Program object first and then
|
||||
// the ShaderObject! Always delete ShaderObjects last!
|
||||
if (_mM) delete ShaderList[i];
|
||||
}
|
||||
glDeleteShader(ProgramObject);
|
||||
CHECK_GL_ERROR();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void glShader::addShader(glShaderObject* ShaderProgram)
|
||||
{
|
||||
if (ShaderProgram==0) return;
|
||||
if (!ShaderProgram->is_compiled)
|
||||
{
|
||||
cout << "**warning** please compile program before adding object! trying to compile now...\n";
|
||||
if (!ShaderProgram->compile())
|
||||
{
|
||||
cout << "...compile ERROR!\n";
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "...ok!\n";
|
||||
}
|
||||
}
|
||||
ShaderList.push_back(ShaderProgram);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::link(void)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (is_linked) // already linked, detach everything first
|
||||
{
|
||||
cout << "**warning** Object is already linked, trying to link again" << endl;
|
||||
for (i=0;i<ShaderList.size();i++)
|
||||
{
|
||||
glDetachShader(ProgramObject, ShaderList[i]->ShaderObject);
|
||||
CHECK_GL_ERROR();
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0;i<ShaderList.size();i++)
|
||||
{
|
||||
glAttachShader(ProgramObject, ShaderList[i]->ShaderObject);
|
||||
CHECK_GL_ERROR();
|
||||
//cout << "attaching ProgramObj [" << i << "] @ 0x" << hex << ShaderList[i]->ProgramObject << " in ShaderObj @ 0x" << ShaderObject << endl;
|
||||
}
|
||||
|
||||
int linked;
|
||||
glLinkProgram(ProgramObject);
|
||||
CHECK_GL_ERROR();
|
||||
glGetProgramiv(ProgramObject, GL_LINK_STATUS, &linked);
|
||||
CHECK_GL_ERROR();
|
||||
|
||||
if (linked)
|
||||
{
|
||||
is_linked = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "**linker error**\n";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Compiler Log: Ausgabe der Compiler Meldungen in String
|
||||
|
||||
char* glShader::getLinkerLog(void)
|
||||
{
|
||||
int blen = 0;
|
||||
int slen = 0;
|
||||
|
||||
if (ProgramObject==0) return aGLSLStrings[2];
|
||||
glGetProgramiv(ProgramObject, GL_INFO_LOG_LENGTH , &blen);
|
||||
CHECK_GL_ERROR();
|
||||
|
||||
if (blen > 1)
|
||||
{
|
||||
if (linker_log!=0)
|
||||
{
|
||||
free(linker_log);
|
||||
linker_log =0;
|
||||
}
|
||||
if ((linker_log = (GLcharARB*)malloc(blen)) == NULL)
|
||||
{
|
||||
printf("ERROR: Could not allocate compiler_log buffer\n");
|
||||
return aGLSLStrings[3];
|
||||
}
|
||||
|
||||
glGetProgramInfoLog(ProgramObject, blen, &slen, linker_log);
|
||||
CHECK_GL_ERROR();
|
||||
}
|
||||
if (linker_log!=0)
|
||||
return (char*) linker_log;
|
||||
else
|
||||
return aGLSLStrings[5];
|
||||
|
||||
return aGLSLStrings[4];
|
||||
}
|
||||
|
||||
void glShader::begin(void)
|
||||
{
|
||||
enabled = true;
|
||||
|
||||
if (ProgramObject == 0) return;
|
||||
if (!_noshader) return;
|
||||
|
||||
if (is_linked)
|
||||
{
|
||||
glUseProgram(ProgramObject);
|
||||
CHECK_GL_ERROR();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void glShader::end(void)
|
||||
{
|
||||
enabled = false;
|
||||
|
||||
if (!_noshader) return;
|
||||
glUseProgram(0);
|
||||
CHECK_GL_ERROR();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniform1f(char* varname, GLfloat v0)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform1f(loc, v0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniform2f(char* varname, GLfloat v0, GLfloat v1)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform2f(loc, v0, v1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniform3f(char* varname, GLfloat v0, GLfloat v1, GLfloat v2)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform3f(loc, v0, v1, v2);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniform4f(char* varname, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform4f(loc, v0, v1, v2, v3);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniform1i(char* varname, GLint v0)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform1i(loc, v0);
|
||||
|
||||
return true;
|
||||
}
|
||||
bool glShader::setUniform2i(char* varname, GLint v0, GLint v1)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform2i(loc, v0, v1);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniform3i(char* varname, GLint v0, GLint v1, GLint v2)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform3i(loc, v0, v1, v2);
|
||||
|
||||
return true;
|
||||
}
|
||||
bool glShader::setUniform4i(char* varname, GLint v0, GLint v1, GLint v2, GLint v3)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform4i(loc, v0, v1, v2, v3);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniform1fv(char* varname, GLsizei count, GLfloat *value)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform1fv(loc, count, value);
|
||||
|
||||
return true;
|
||||
}
|
||||
bool glShader::setUniform2fv(char* varname, GLsizei count, GLfloat *value)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform2fv(loc, count, value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniform3fv(char* varname, GLsizei count, GLfloat *value)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform3fv(loc, count, value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniform4fv(char* varname, GLsizei count, GLfloat *value)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform4fv(loc, count, value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniform1iv(char* varname, GLsizei count, GLint *value)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform1iv(loc, count, value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniform2iv(char* varname, GLsizei count, GLint *value)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform2iv(loc, count, value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniform3iv(char* varname, GLsizei count, GLint *value)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform3iv(loc, count, value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniform4iv(char* varname, GLsizei count, GLint *value)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniform4iv(loc, count, value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniformMatrix2fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniformMatrix2fv(loc, count, transpose, value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniformMatrix3fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniformMatrix3fv(loc, count, transpose, value);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool glShader::setUniformMatrix4fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
GLint loc = GetUniLoc(varname);
|
||||
if (loc==-1) return false; // can't find variable
|
||||
|
||||
glUniformMatrix4fv(loc, count, transpose, value);
|
||||
CHECK_GL_ERROR();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
GLint glShader::GetUniLoc(const GLcharARB *name)
|
||||
{
|
||||
GLint loc;
|
||||
|
||||
loc = glGetUniformLocation(ProgramObject, name);
|
||||
if (loc == -1)
|
||||
{
|
||||
cout << "Error: can't find uniform variable \"" << name << "\"\n";
|
||||
}
|
||||
CHECK_GL_ERROR();
|
||||
return loc;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void glShader::GetUniformfv(char* name, GLfloat* values)
|
||||
{
|
||||
GLint loc;
|
||||
|
||||
loc = glGetUniformLocation(ProgramObject, name);
|
||||
if (loc == -1)
|
||||
{
|
||||
cout << "Error: can't find uniform variable \"" << name << "\"\n";
|
||||
}
|
||||
glGetUniformfv(ProgramObject, loc, values);
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void glShader::GetUniformiv(char* name, GLint* values)
|
||||
{
|
||||
GLint loc;
|
||||
|
||||
loc = glGetUniformLocation(ProgramObject, name);
|
||||
if (loc == -1)
|
||||
{
|
||||
cout << "Error: can't find uniform variable \"" << name << "\"\n";
|
||||
}
|
||||
|
||||
glGetUniformiv(ProgramObject, loc, values);
|
||||
|
||||
}
|
||||
|
||||
bool glShader::setVertexAttrib1f(GLuint index, GLfloat v0)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
glVertexAttrib1f(index, v0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool glShader::setVertexAttrib2f(GLuint index, GLfloat v0, GLfloat v1)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
glVertexAttrib2f(index, v0, v1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool glShader::setVertexAttrib3f(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
glVertexAttrib3f(index, v0, v1, v2);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool glShader::setVertexAttrib4f(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
|
||||
{
|
||||
if (!_noshader) return true;
|
||||
|
||||
glVertexAttrib4f(index, v0, v1, v2, v3);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ************************************************************************
|
||||
// Shader Program : Manage Shader Programs (Vertex/Fragment)
|
||||
// ************************************************************************
|
||||
|
||||
|
||||
glShaderObject::glShaderObject(int type)
|
||||
{
|
||||
program_type = type;
|
||||
program_str = "empty";
|
||||
|
||||
if (type==GL_VERTEX_SHADER) program_str=string("GL_VERTEX_SHADER");
|
||||
if (type==GL_TESS_CONTROL_SHADER) program_str=string("GL_TESS_CONTROL_SHADER");
|
||||
if (type==GL_TESS_EVALUATION_SHADER) program_str=string("GL_TESS_EVALUATION_SHADER");
|
||||
if (type==GL_GEOMETRY_SHADER) program_str=string("GL_GEOMETRY_SHADER");
|
||||
if (type==GL_FRAGMENT_SHADER) program_str=string("GL_FRAGMENT_SHADER");
|
||||
|
||||
//GL_VERTEX_SHADER
|
||||
//GL_TESS_CONTROL_SHADER
|
||||
//GL_TESS_EVALUATION_SHADER
|
||||
//GL_GEOMETRY_SHADER
|
||||
//GL_FRAGMENT_SHADER
|
||||
|
||||
ShaderObject = glCreateShaderObjectARB(type);
|
||||
|
||||
CHECK_GL_ERROR();
|
||||
|
||||
compiler_log = 0;
|
||||
is_compiled = false;
|
||||
ShaderObject = 0;
|
||||
ShaderSource = 0;
|
||||
_memalloc = false;
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
glShaderObject::~glShaderObject()
|
||||
{
|
||||
if (compiler_log!=0) free(compiler_log);
|
||||
if (ShaderSource!=0)
|
||||
{
|
||||
if (_memalloc)
|
||||
delete[] ShaderSource; // free ASCII Source
|
||||
}
|
||||
|
||||
if (is_compiled)
|
||||
{
|
||||
glDeleteObjectARB(ShaderObject);
|
||||
CHECK_GL_ERROR();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
unsigned long getFileLength(ifstream& file)
|
||||
{
|
||||
if(!file.good()) return 0;
|
||||
|
||||
unsigned long pos=file.tellg();
|
||||
file.seekg(0,ios::end);
|
||||
unsigned long len = file.tellg();
|
||||
file.seekg(ios::beg);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
int glShaderObject::load(char* filename)
|
||||
{
|
||||
printf("Loading Shader %s ...\n",filename);
|
||||
|
||||
ifstream file;
|
||||
file.open(filename, ios::in);
|
||||
if(!file)
|
||||
{
|
||||
printf("File not found :%s ...\n",filename);
|
||||
while(1);
|
||||
};
|
||||
|
||||
unsigned long len = getFileLength(file);
|
||||
file.close();
|
||||
|
||||
if (len==0) return -2; // "Empty File"
|
||||
|
||||
if (ShaderSource!=0) // there is already a source loaded, free it!
|
||||
{
|
||||
if (_memalloc)
|
||||
delete[] ShaderSource;
|
||||
}
|
||||
|
||||
ShaderSource = (GLubyte*) new char[len+1];
|
||||
if (ShaderSource == 0) return -3; // can't reserve memory
|
||||
_memalloc = true;
|
||||
|
||||
printf("Loading Shader %s ...\n",filename);
|
||||
ShaderSource[len] = 0; // len isn't always strlen cause some characters are stripped in ascii read...
|
||||
// it is important to 0-terminate the real length later, len is just max possible value...
|
||||
|
||||
FILE* fn=fopen(filename, "rb");
|
||||
fseek(fn,0,SEEK_SET);
|
||||
int numbytes=(int)fread(ShaderSource, 1 , len, fn);
|
||||
fclose(fn);
|
||||
|
||||
printf("Read %d of %d bytes\n",numbytes,len);
|
||||
//printf("Program: %s\n",ShaderSource);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void glShaderObject::loadFromMemory(const char* program)
|
||||
{
|
||||
if (ShaderSource!=0) // there is already a source loaded, free it!
|
||||
{
|
||||
if (_memalloc)
|
||||
delete[] ShaderSource;
|
||||
}
|
||||
_memalloc = false;
|
||||
ShaderSource = (GLubyte*) program;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Compiler Log: Ausgabe der Compiler Meldungen in String
|
||||
|
||||
char* glShaderObject::getCompilerLog(void)
|
||||
{
|
||||
int blen = 0;
|
||||
int slen = 0;
|
||||
|
||||
if (ShaderObject==0) return aGLSLStrings[1]; // not a valid program object
|
||||
|
||||
glGetShaderiv(ShaderObject, GL_INFO_LOG_LENGTH , &blen);
|
||||
CHECK_GL_ERROR();
|
||||
|
||||
if (blen > 1)
|
||||
{
|
||||
if (compiler_log!=0)
|
||||
{
|
||||
free(compiler_log);
|
||||
compiler_log =0;
|
||||
}
|
||||
if ((compiler_log = (GLcharARB*)malloc(blen)) == NULL)
|
||||
{
|
||||
printf("ERROR: Could not allocate compiler_log buffer\n");
|
||||
return aGLSLStrings[3];
|
||||
}
|
||||
|
||||
glGetInfoLogARB(ShaderObject, blen, &slen, compiler_log);
|
||||
CHECK_GL_ERROR();
|
||||
//cout << "compiler_log: \n", compiler_log);
|
||||
}
|
||||
if (compiler_log!=0)
|
||||
return (char*) compiler_log;
|
||||
else
|
||||
return aGLSLStrings[6];
|
||||
|
||||
return aGLSLStrings[4];
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool glShaderObject::compile(void)
|
||||
{
|
||||
is_compiled = false;
|
||||
|
||||
int compiled = 0;
|
||||
|
||||
if (ShaderSource==0) return false;
|
||||
|
||||
GLint length = (GLint) strlen((const char*)ShaderSource);
|
||||
CHECK_GL_ERROR();
|
||||
glShaderSource(ShaderObject, 1, (const GLchar **)&ShaderSource, &length);
|
||||
CHECK_GL_ERROR();
|
||||
|
||||
glCompileShader(ShaderObject);
|
||||
CHECK_GL_ERROR();
|
||||
glGetObjectParameterivARB(ShaderObject, GL_COMPILE_STATUS, &compiled);
|
||||
CHECK_GL_ERROR();
|
||||
|
||||
if (compiled) is_compiled=true;
|
||||
|
||||
return is_compiled;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
GLint glShaderObject::getAttribLocation(char* attribName)
|
||||
{
|
||||
return glGetAttribLocationARB(ShaderObject, attribName);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ShaderManager: Easy use of (multiple) Shaders
|
||||
|
||||
glShaderManager::glShaderManager()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
glShaderManager::~glShaderManager()
|
||||
{
|
||||
// free objects
|
||||
vector<glShader*>::iterator i=_shaderObjectList.begin();
|
||||
while (i!=_shaderObjectList.end())
|
||||
{
|
||||
//glShader* o = *i;
|
||||
i=_shaderObjectList.erase(i);
|
||||
//delete o;
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
glShader* glShaderManager::loadfromFile(char* vertexFile, char* fragmentFile, char* tesscontrolFile, char* tessevalFile, char* geometryFile)
|
||||
{
|
||||
glShader* o = new glShader();
|
||||
|
||||
glShaderObject* shaders[5];
|
||||
shaders[0]= new glShaderObject(GL_VERTEX_SHADER);
|
||||
shaders[1]= new glShaderObject(GL_TESS_CONTROL_SHADER);
|
||||
shaders[2]= new glShaderObject(GL_TESS_EVALUATION_SHADER);
|
||||
shaders[3]= new glShaderObject(GL_GEOMETRY_SHADER);
|
||||
shaders[4]= new glShaderObject(GL_FRAGMENT_SHADER);
|
||||
|
||||
char* filename[5];
|
||||
filename[0]=vertexFile;
|
||||
filename[1]=tesscontrolFile;
|
||||
filename[2]=tessevalFile;
|
||||
filename[3]=geometryFile;
|
||||
filename[4]=fragmentFile;
|
||||
|
||||
for (int i=0;i<5;i++)
|
||||
{
|
||||
if(filename[i]!=0)
|
||||
{
|
||||
printf("Loading: %s\n",filename[i]);
|
||||
// Load program
|
||||
if (shaders[i]->load(filename[i]) != 0)
|
||||
{
|
||||
cout << "error: can't load " << filename[i] << endl;
|
||||
while(1);
|
||||
}
|
||||
printf("Compiling: %s\n",filename[i]);
|
||||
|
||||
// Compile vertex program
|
||||
if (!shaders[i]->compile())
|
||||
{
|
||||
cout << "***COMPILER ERROR (" << shaders[i]->program_str.c_str() << "):\n";
|
||||
cout << shaders[i]->getCompilerLog() << endl;
|
||||
while(1);
|
||||
}
|
||||
|
||||
cout << "***GLSL Compiler Log (" << shaders[i]->program_str.c_str() << "):\n";
|
||||
cout << shaders[i]->getCompilerLog() << "\n";
|
||||
|
||||
// Add to object
|
||||
o->addShader(shaders[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// link
|
||||
if (!o->link())
|
||||
{
|
||||
cout << "**LINKER ERROR\n";
|
||||
cout << o->getLinkerLog() << endl;
|
||||
while(1);
|
||||
}
|
||||
cout << "***GLSL Linker Log:\n";
|
||||
cout << o->getLinkerLog() << endl;
|
||||
|
||||
_shaderObjectList.push_back(o);
|
||||
o->manageMemory();
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
glShader* glShaderManager::loadfromMemory(char* vertexMem, char* fragmentMem, char* tesscontrolMem, char* tessevalMem, char* geometryMem)
|
||||
{
|
||||
glShader* o = new glShader();
|
||||
|
||||
glShaderObject* shaders[5];
|
||||
shaders[0]= new glShaderObject(GL_VERTEX_SHADER);
|
||||
shaders[1]= new glShaderObject(GL_TESS_CONTROL_SHADER);
|
||||
shaders[2]= new glShaderObject(GL_TESS_EVALUATION_SHADER);
|
||||
shaders[3]= new glShaderObject(GL_GEOMETRY_SHADER);
|
||||
shaders[4]= new glShaderObject(GL_FRAGMENT_SHADER);
|
||||
|
||||
char* mem[5];
|
||||
mem[0]=vertexMem;
|
||||
mem[1]=tesscontrolMem;
|
||||
mem[2]=tessevalMem;
|
||||
mem[3]=geometryMem;
|
||||
mem[4]=fragmentMem;
|
||||
|
||||
for (int i=0;i<5;i++)
|
||||
{
|
||||
if(mem[i]!=0)
|
||||
{
|
||||
// Load program
|
||||
shaders[i]->loadFromMemory(mem[i]);
|
||||
|
||||
// Compile vertex program
|
||||
if (!shaders[i]->compile())
|
||||
{
|
||||
cout << "***COMPILER ERROR (" << shaders[i]->program_str.c_str() << "):\n";
|
||||
cout << shaders[i]->getCompilerLog() << endl;
|
||||
while(1);
|
||||
}
|
||||
|
||||
cout << "***GLSL Compiler Log (" << shaders[i]->program_str.c_str() << "):\n";
|
||||
cout << shaders[i]->getCompilerLog() << "\n";
|
||||
|
||||
// Add to object
|
||||
o->addShader(shaders[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// link
|
||||
if (!o->link())
|
||||
{
|
||||
cout << "**LINKER ERROR\n";
|
||||
cout << o->getLinkerLog() << endl;
|
||||
while(1);
|
||||
}
|
||||
cout << "***GLSL Linker Log:\n";
|
||||
cout << o->getLinkerLog() << endl;
|
||||
|
||||
_shaderObjectList.push_back(o);
|
||||
o->manageMemory();
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool glShaderManager::free(glShader* o)
|
||||
{
|
||||
vector<glShader*>::iterator i=_shaderObjectList.begin();
|
||||
while (i!=_shaderObjectList.end())
|
||||
{
|
||||
if ((*i)==o)
|
||||
{
|
||||
_shaderObjectList.erase(i);
|
||||
delete o;
|
||||
return true;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
186
documents/Tesselation_Tutorial/ext/glsl.h
Normal file
186
documents/Tesselation_Tutorial/ext/glsl.h
Normal file
@@ -0,0 +1,186 @@
|
||||
/******************************************************************************
|
||||
aGLSL.h
|
||||
Version: 0.9.4 - For OpenGL 2.0
|
||||
Last update: 2005/07/07
|
||||
|
||||
===============
|
||||
CHANGES 0.9.4
|
||||
===============
|
||||
|
||||
[1] Upgraded to GLEW-1.3.3
|
||||
|
||||
[2] GLSL.h now uses OpenGL 2.0 functions only.
|
||||
(Renamed all "ancient" ARB functions to the new OpenGL 2.0 function names)
|
||||
|
||||
[3] To remove confusion with OpenGL naming, the class aShaderProgram
|
||||
was renamed to glShaderObject.
|
||||
|
||||
[4] removed the function initGLSL()
|
||||
added a function initGLExtensions()
|
||||
added a function checkGLSL() which returns false if GLSL is unavailable
|
||||
added a function checkGL2() which returns false if OpenGL 2.0 is unavailable
|
||||
|
||||
[5] renamed methods:
|
||||
sendUnifomX -> setUniformX
|
||||
VertexAttribX -> setVertexAttrib1f
|
||||
|
||||
******************************************************************************
|
||||
(c) 2003-2005 by Martin Christen. All Rights reserved.
|
||||
License: BSD
|
||||
******************************************************************************/
|
||||
#ifndef A_GLSL_H
|
||||
#define A_GLSL_H
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <algorithm>
|
||||
#include <math.h>
|
||||
#include <GLew.h>
|
||||
#include <GL/glut.h>// Header File For The GLUT Library
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <windows.h>
|
||||
//-----------------------------------------------------------------------------
|
||||
int CheckGLError(char *file, int line);
|
||||
#define CHECK_GL_ERROR() CheckGLError(__FILE__, __LINE__)
|
||||
|
||||
class glShaderObject
|
||||
{
|
||||
friend class glShader;
|
||||
|
||||
public:
|
||||
glShaderObject(int type);
|
||||
~glShaderObject();
|
||||
|
||||
int load(char* filename); //!< read file, if result is 0 everything is ok. -1: File not found, -2: Empty File, -3: no memory
|
||||
void loadFromMemory(const char* program); //!< load program from char array, make sure program is 0 terminated!
|
||||
|
||||
bool compile(void); //!< compile program
|
||||
char* getCompilerLog(void); //!< get compiler messages
|
||||
GLint getAttribLocation(char* attribName); //!< returns Attribute Location. Specify attribute name.
|
||||
|
||||
std::string program_str;
|
||||
|
||||
protected:
|
||||
|
||||
int program_type; //!< 1=Vertex Program, 2=Fragment Program, 0=none
|
||||
|
||||
GLuint ShaderObject; //!< Program Object
|
||||
GLubyte* ShaderSource; //!< ASCII Source-Code
|
||||
|
||||
GLcharARB* compiler_log;
|
||||
|
||||
bool is_compiled; //!< true if compiled
|
||||
bool _memalloc; //!< true if shader allocated memory
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class glShader
|
||||
{
|
||||
public:
|
||||
glShader();
|
||||
virtual ~glShader();
|
||||
void addShader(glShaderObject* ShaderProgram); //!< add a Vertex or Fragment Program
|
||||
|
||||
bool link(void); //!< Link all Shaders
|
||||
char* getLinkerLog(void); //!< get Linker messages
|
||||
|
||||
void begin(); //!< use Shader. OpenGL calls will go through shader.
|
||||
void end(); //!< Stop using this shader. OpenGL calls will go through regular pipeline.
|
||||
|
||||
bool enabled;
|
||||
|
||||
// Uniform Variables
|
||||
bool setUniform1f(char* varname, GLfloat v0); //!< set float uniform to program
|
||||
bool setUniform2f(char* varname, GLfloat v0, GLfloat v1); //!< set vec2 uniform to program
|
||||
bool setUniform3f(char* varname, GLfloat v0, GLfloat v1, GLfloat v2); //!< set vec3 uniform to program
|
||||
bool setUniform4f(char* varname, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); //!< set vec4 uniform to program
|
||||
|
||||
bool setUniform1i(char* varname, GLint v0);
|
||||
bool setUniform2i(char* varname, GLint v0, GLint v1);
|
||||
bool setUniform3i(char* varname, GLint v0, GLint v1, GLint v2);
|
||||
bool setUniform4i(char* varname, GLint v0, GLint v1, GLint v2, GLint v3);
|
||||
|
||||
bool setUniform1fv(char* varname, GLsizei count, GLfloat *value);
|
||||
bool setUniform2fv(char* varname, GLsizei count, GLfloat *value);
|
||||
bool setUniform3fv(char* varname, GLsizei count, GLfloat *value);
|
||||
bool setUniform4fv(char* varname, GLsizei count, GLfloat *value);
|
||||
bool setUniform1iv(char* varname, GLsizei count, GLint *value);
|
||||
bool setUniform2iv(char* varname, GLsizei count, GLint *value);
|
||||
bool setUniform3iv(char* varname, GLsizei count, GLint *value);
|
||||
bool setUniform4iv(char* varname, GLsizei count, GLint *value);
|
||||
|
||||
bool setUniformMatrix2fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value);
|
||||
bool setUniformMatrix3fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value);
|
||||
bool setUniformMatrix4fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value);
|
||||
|
||||
// Receive Uniform variables:
|
||||
void GetUniformfv(char* name, GLfloat* values);
|
||||
void GetUniformiv(char* name, GLint* values);
|
||||
|
||||
// Vertex Attributes
|
||||
bool setVertexAttrib1f(GLuint index, GLfloat v0);
|
||||
bool setVertexAttrib2f(GLuint index, GLfloat v0, GLfloat v1);
|
||||
bool setVertexAttrib3f(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2);
|
||||
bool setVertexAttrib4f(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
|
||||
|
||||
void manageMemory(void){_mM = true;}
|
||||
|
||||
void enable(void)
|
||||
{
|
||||
_noshader = true;
|
||||
}
|
||||
void disable(void)
|
||||
{
|
||||
_noshader = false;
|
||||
}
|
||||
|
||||
private:
|
||||
GLint GetUniLoc(const GLcharARB *name); // get location of a variable
|
||||
|
||||
GLuint ProgramObject; // GLProgramObject
|
||||
|
||||
|
||||
GLcharARB* linker_log;
|
||||
bool is_linked;
|
||||
std::vector<glShaderObject*> ShaderList; // List of all Shader Programs
|
||||
|
||||
bool _mM;
|
||||
bool _noshader;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// To simplify the process loading/compiling/linking shaders I created this
|
||||
// high level interface to setup a vertex/fragment shader.
|
||||
//
|
||||
// Example:
|
||||
// /*LOAD:*/
|
||||
// glShaderManager SM;
|
||||
// glShader* shader = SM.loadfromFile("test.vert","test.frag");
|
||||
// if (shader==0) cout << "Error Loading, compiling or linking shader\n";
|
||||
// /*DRAW:*/
|
||||
// shader->begin();
|
||||
// shader->setUniform1f("MyFloat", 1.123);
|
||||
// glutDrawSolidSphere(1.0);
|
||||
// shader->end();
|
||||
//
|
||||
|
||||
class glShaderManager
|
||||
{
|
||||
public:
|
||||
glShaderManager();
|
||||
virtual ~glShaderManager();
|
||||
|
||||
glShader* loadfromFile(char* vertexFile, char* fragmentFile, char* tesscontrolFile, char* tessevalFile, char* geometryFile); // load vertex/fragment shader from file
|
||||
glShader* loadfromMemory(char* vertexMem, char* fragmentMem, char* tesscontrolMem, char* tessevalMem, char* geometryMem);
|
||||
|
||||
bool free(glShader* o);
|
||||
|
||||
private:
|
||||
std::vector<glShader*> _shaderObjectList;
|
||||
|
||||
};
|
||||
|
||||
#endif // A_GLSL_H
|
||||
1510
documents/Tesselation_Tutorial/ext/glxew.h
Normal file
1510
documents/Tesselation_Tutorial/ext/glxew.h
Normal file
File diff suppressed because it is too large
Load Diff
1260
documents/Tesselation_Tutorial/ext/wglew.h
Normal file
1260
documents/Tesselation_Tutorial/ext/wglew.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
documents/Tesselation_Tutorial/lib32/glut32.lib
Normal file
BIN
documents/Tesselation_Tutorial/lib32/glut32.lib
Normal file
Binary file not shown.
BIN
documents/Tesselation_Tutorial/lib64/glut32.lib
Normal file
BIN
documents/Tesselation_Tutorial/lib64/glut32.lib
Normal file
Binary file not shown.
10
documents/Tesselation_Tutorial/shader/tess_frag.txt
Normal file
10
documents/Tesselation_Tutorial/shader/tess_frag.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
#version 410 core
|
||||
|
||||
layout(location = 0, index = 0) out vec4 fragColor;
|
||||
|
||||
//in vec4 color_gs;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
fragColor = vec4(1.0,1.0,1.0,1.0);
|
||||
}
|
||||
19
documents/Tesselation_Tutorial/shader/tess_geo.txt
Normal file
19
documents/Tesselation_Tutorial/shader/tess_geo.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 410 core
|
||||
|
||||
layout(triangles, invocations = 1) in;
|
||||
layout(line_strip, max_vertices = 4) out;
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_Position = gl_in[0].gl_Position;
|
||||
EmitVertex();
|
||||
gl_Position = gl_in[1].gl_Position;
|
||||
EmitVertex();
|
||||
gl_Position = gl_in[2].gl_Position;
|
||||
EmitVertex();
|
||||
//gl_Position = gl_in[3].gl_Position;
|
||||
//EmitVertex();
|
||||
|
||||
EndPrimitive();
|
||||
}
|
||||
16
documents/Tesselation_Tutorial/shader/tess_quad_tcs.txt
Normal file
16
documents/Tesselation_Tutorial/shader/tess_quad_tcs.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
#version 410 core
|
||||
|
||||
layout(vertices = 4) out;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_TessLevelOuter[0] = 2.0;
|
||||
gl_TessLevelOuter[1] = 4.0;
|
||||
gl_TessLevelOuter[2] = 6.0;
|
||||
gl_TessLevelOuter[3] = 8.0;
|
||||
|
||||
gl_TessLevelInner[0] = 8.0;
|
||||
gl_TessLevelInner[1] = 8.0;
|
||||
|
||||
gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
|
||||
}
|
||||
20
documents/Tesselation_Tutorial/shader/tess_quad_tes.txt
Normal file
20
documents/Tesselation_Tutorial/shader/tess_quad_tes.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
#version 410 core
|
||||
|
||||
layout(quads, equal_spacing, ccw) in;
|
||||
|
||||
//quad interpol
|
||||
vec4 interpolate(in vec4 v0, in vec4 v1, in vec4 v2, in vec4 v3)
|
||||
{
|
||||
vec4 a = mix(v0, v1, gl_TessCoord.x);
|
||||
vec4 b = mix(v3, v2, gl_TessCoord.x);
|
||||
return mix(a, b, gl_TessCoord.y);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = interpolate(
|
||||
gl_in[0].gl_Position,
|
||||
gl_in[1].gl_Position,
|
||||
gl_in[2].gl_Position,
|
||||
gl_in[3].gl_Position);
|
||||
}
|
||||
14
documents/Tesselation_Tutorial/shader/tess_tri_tcs.txt
Normal file
14
documents/Tesselation_Tutorial/shader/tess_tri_tcs.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
#version 410 core
|
||||
|
||||
layout(vertices = 3) out;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_TessLevelOuter[0] = 2.0;
|
||||
gl_TessLevelOuter[1] = 4.0;
|
||||
gl_TessLevelOuter[2] = 6.0;
|
||||
|
||||
gl_TessLevelInner[0] = 8.0;
|
||||
|
||||
gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
|
||||
}
|
||||
10
documents/Tesselation_Tutorial/shader/tess_tri_tes.txt
Normal file
10
documents/Tesselation_Tutorial/shader/tess_tri_tes.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
#version 410 core
|
||||
|
||||
layout(triangles, equal_spacing, ccw) in;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position.xyzw = gl_in[0].gl_Position.xyzw * gl_TessCoord.x +
|
||||
gl_in[1].gl_Position.xyzw * gl_TessCoord.y +
|
||||
gl_in[2].gl_Position.xyzw * gl_TessCoord.z;
|
||||
}
|
||||
15
documents/Tesselation_Tutorial/shader/tess_vs.txt
Normal file
15
documents/Tesselation_Tutorial/shader/tess_vs.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 410 core
|
||||
|
||||
uniform mat4 projectionMatrix;
|
||||
uniform mat4 modelViewMatrix;
|
||||
|
||||
in vec4 gl_Vertex;
|
||||
in vec3 gl_Color;
|
||||
|
||||
out vec4 color_vs;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
color_vs.xyz = gl_Color.xyz;//mix( vec4(1,1,0,0),vec4(0,1,1,0), vertex.w);
|
||||
gl_Position = projectionMatrix*modelViewMatrix*vec4(gl_Vertex.xyz,1.0);
|
||||
}
|
||||
121
documents/Tesselation_Tutorial/src/Main.cpp
Normal file
121
documents/Tesselation_Tutorial/src/Main.cpp
Normal file
@@ -0,0 +1,121 @@
|
||||
/////////////////////////////////////////////
|
||||
// This source is licensed under MIT license
|
||||
/////////////////////////////////////////////
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#include <glew.h>
|
||||
#include <wglew.h>
|
||||
#include <GL/glut.h>// Header File For The GLUT Library
|
||||
using namespace std;
|
||||
#include "glsl.h"
|
||||
///////////////////////////////////////////
|
||||
void DrawScene()
|
||||
{
|
||||
glClearDepth(1.0f);
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
static bool init=true;
|
||||
static Shader quad_shader("Quad Shader");
|
||||
static Shader tri_shader("Triangle Shader");
|
||||
|
||||
static int VBOvert=0;
|
||||
const int num_floats=4*4;
|
||||
|
||||
if(init)
|
||||
{
|
||||
/*+++++++++++++++++++++++++++++++++++++*/
|
||||
std::cout << "GL_VERSION: " << glGetString(GL_VERSION) << std::endl; //std::cout << "GL_EXTENSIONS: " << glGetString(GL_EXTENSIONS) << std::endl;
|
||||
std::cout << "GL_RENDERER: " << glGetString(GL_RENDERER) << std::endl;
|
||||
std::cout << "GL_VENDOR: " << glGetString(GL_VENDOR) << std::endl;
|
||||
std::cout << "GLU_VERSION: " << gluGetString(GLU_VERSION) << std::endl; //std::cout << "GLU_EXTENSIONS: " << gluGetString(GLU_EXTENSIONS) << std::endl;
|
||||
std::cout << "GLUT_API_VERSION: " << GLUT_API_VERSION << std::endl;
|
||||
/*+++++++++++++++++++++++++++++++++++++*/
|
||||
quad_shader.attach(GL_VERTEX_SHADER,"../shader/tess_vs.txt");
|
||||
quad_shader.attach(GL_FRAGMENT_SHADER,"../shader/tess_frag.txt");
|
||||
quad_shader.attach(GL_GEOMETRY_SHADER,"../shader/tess_geo.txt");
|
||||
quad_shader.attach(GL_TESS_CONTROL_SHADER,"../shader/tess_quad_tcs.txt");
|
||||
quad_shader.attach(GL_TESS_EVALUATION_SHADER,"../shader/tess_quad_tes.txt");
|
||||
quad_shader.link();
|
||||
/*+++++++++++++++++++++++++++++++++++++*/
|
||||
tri_shader.attach(GL_VERTEX_SHADER,"../shader/tess_vs.txt");
|
||||
tri_shader.attach(GL_FRAGMENT_SHADER,"../shader/tess_frag.txt");
|
||||
tri_shader.attach(GL_GEOMETRY_SHADER,"../shader/tess_geo.txt");
|
||||
tri_shader.attach(GL_TESS_CONTROL_SHADER,"../shader/tess_tri_tcs.txt");
|
||||
tri_shader.attach(GL_TESS_EVALUATION_SHADER,"../shader/tess_tri_tes.txt");
|
||||
tri_shader.link();
|
||||
/*+++++++++++++++++++++++++++++++++++++*/
|
||||
float vert[num_floats] = {
|
||||
- 0.3 , -0.3 , 0 , 0.3, // upleft
|
||||
0.3 , -0.3 , 0 , 0.6, // upright
|
||||
0.3 , 0.3 , 0 , 0.4, // downright
|
||||
- 0.3 , 0.3 , 0 , 0.1 // downleft
|
||||
};
|
||||
glGenBuffers(1, (GLuint *)(&VBOvert));
|
||||
glBindBuffer(GL_ARRAY_BUFFER, VBOvert);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(float)*num_floats,vert, GL_DYNAMIC_DRAW_ARB );
|
||||
glPointSize(10);
|
||||
/*+++++++++++++++++++++++++++++++++++++*/
|
||||
init=false;
|
||||
/*+++++++++++++++++++++++++++++++++++++*/
|
||||
}
|
||||
glMatrixMode( GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
|
||||
glMatrixMode( GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
float Projection[16];
|
||||
float Modelview[16];
|
||||
glGetFloatv(GL_PROJECTION_MATRIX, Projection); CHECK_GL_ERROR();
|
||||
glTranslatef(-0.5,0,0);
|
||||
glGetFloatv(GL_MODELVIEW_MATRIX, Modelview);
|
||||
|
||||
// Enable VBO
|
||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, VBOvert); CHECK_GL_ERROR();
|
||||
glEnableClientState(GL_VERTEX_ARRAY); CHECK_GL_ERROR();
|
||||
glVertexPointer ( 4, GL_FLOAT,0, (char *) 0); CHECK_GL_ERROR();
|
||||
|
||||
// Quad Mesh
|
||||
quad_shader.begin();
|
||||
quad_shader.setUniformMatrix4fv("projectionMatrix", 1, 0, Projection); CHECK_GL_ERROR();
|
||||
quad_shader.setUniformMatrix4fv("modelViewMatrix", 1, 0, Modelview); CHECK_GL_ERROR();
|
||||
glPatchParameteri(GL_PATCH_VERTICES, 4);
|
||||
glDrawArrays( GL_PATCHES, 0, 4); CHECK_GL_ERROR();
|
||||
quad_shader.end();
|
||||
|
||||
glTranslatef(1,0,0);
|
||||
glGetFloatv(GL_MODELVIEW_MATRIX, Modelview);
|
||||
|
||||
// Triangle Mesh
|
||||
tri_shader.begin();
|
||||
tri_shader.setUniformMatrix4fv("projectionMatrix", 1, 0, Projection); CHECK_GL_ERROR();
|
||||
tri_shader.setUniformMatrix4fv("modelViewMatrix", 1, 0, Modelview); CHECK_GL_ERROR();
|
||||
glPatchParameteri(GL_PATCH_VERTICES, 3);
|
||||
glDrawArrays( GL_PATCHES, 0, 3); CHECK_GL_ERROR();
|
||||
tri_shader.end();
|
||||
|
||||
// Disable VBO
|
||||
glDisableClientState(GL_VERTEX_ARRAY); CHECK_GL_ERROR();
|
||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); CHECK_GL_ERROR();
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
///////////////////////////////////////////
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
|
||||
glutInitWindowSize(800, 600);
|
||||
glutInitWindowPosition(0, 0);
|
||||
glutCreateWindow("Tesselation Example (c) Sven Forstmann 2011");
|
||||
glutDisplayFunc(DrawScene);
|
||||
glutIdleFunc(DrawScene);
|
||||
glewInit();
|
||||
wglSwapIntervalEXT(0);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
///////////////////////////////////////////
|
||||
404
documents/Tesselation_Tutorial/src/Tesselation.vcproj
Normal file
404
documents/Tesselation_Tutorial/src/Tesselation.vcproj
Normal file
@@ -0,0 +1,404 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="Tesselation"
|
||||
ProjectGUID="{98864040-E723-43CF-9479-6FBCDF2F6C51}"
|
||||
RootNamespace="Cutscene"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\ext"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="0"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="strmiids.lib winmm.lib glut32.lib "
|
||||
OutputFile="..\bin32\$(ProjectName).exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\lib32"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\ext"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="0"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="strmiids.lib winmm.lib glut32.lib "
|
||||
OutputFile="..\bin64\$(ProjectName).exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\lib64"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="..\ext"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS"
|
||||
RuntimeLibrary="2"
|
||||
TreatWChar_tAsBuiltInType="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="0"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="strmiids.lib winmm.lib glut32.lib "
|
||||
OutputFile="..\bin32\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\lib32"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="..\ext"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="0"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="strmiids.lib winmm.lib glut32.lib "
|
||||
OutputFile="..\bin64\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\lib64"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="src"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\glsl.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Main.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="ext"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\ext\glew.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ext\glew.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ext\glxew.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\ext\wglew.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="shader"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\shader\tess_frag.txt"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\shader\tess_geo.txt"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\shader\tess_quad_tcs.txt"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\shader\tess_quad_tes.txt"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\shader\tess_tri_tcs.txt"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\shader\tess_tri_tes.txt"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\shader\tess_vs.txt"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
205
documents/Tesselation_Tutorial/src/Tesselation.vcxproj
Normal file
205
documents/Tesselation_Tutorial/src/Tesselation.vcxproj
Normal file
@@ -0,0 +1,205 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{98864040-E723-43CF-9479-6FBCDF2F6C51}</ProjectGuid>
|
||||
<RootNamespace>Cutscene</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
<PlatformToolset>Windows7.1SDK</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\ext;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>TurnOffAllWarnings</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>strmiids.lib;winmm.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>..\bin32\$(ProjectName).exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\lib32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\ext;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>TurnOffAllWarnings</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>strmiids.lib;winmm.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>..\bin64\$(ProjectName).exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories>..\ext;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>TurnOffAllWarnings</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>strmiids.lib;winmm.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>..\bin32\$(ProjectName).exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\lib32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories>..\ext;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>TurnOffAllWarnings</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>glut32.lib</AdditionalDependencies>
|
||||
<OutputFile>..\bin64\$(ProjectName).exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="glsl.h" />
|
||||
<ClInclude Include="..\ext\glew.h" />
|
||||
<ClInclude Include="..\ext\glxew.h" />
|
||||
<ClInclude Include="..\ext\wglew.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Main.cpp" />
|
||||
<ClCompile Include="..\ext\glew.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\shader\tess_frag.txt" />
|
||||
<None Include="..\shader\tess_geo.txt" />
|
||||
<None Include="..\shader\tess_quad_tcs.txt" />
|
||||
<None Include="..\shader\tess_quad_tes.txt" />
|
||||
<None Include="..\shader\tess_tri_tcs.txt" />
|
||||
<None Include="..\shader\tess_tri_tes.txt" />
|
||||
<None Include="..\shader\tess_vs.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{0afe1f4c-a089-43f2-9880-9653e3e32383}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ext">
|
||||
<UniqueIdentifier>{68ac1930-7cbf-408a-97bd-650bca509cb8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="shader">
|
||||
<UniqueIdentifier>{9598472a-f3af-468e-b477-a16a6fc8fb2d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="glsl.h">
|
||||
<Filter>src</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\ext\glew.h">
|
||||
<Filter>ext</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\ext\glxew.h">
|
||||
<Filter>ext</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\ext\wglew.h">
|
||||
<Filter>ext</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Main.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\ext\glew.cpp">
|
||||
<Filter>ext</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\shader\tess_frag.txt">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="..\shader\tess_geo.txt">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="..\shader\tess_quad_tcs.txt">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="..\shader\tess_quad_tes.txt">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="..\shader\tess_tri_tcs.txt">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="..\shader\tess_tri_tes.txt">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="..\shader\tess_vs.txt">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LocalDebuggerCommand>..\bin64\$(ProjectName).exe</LocalDebuggerCommand>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
122
documents/Tesselation_Tutorial/src/glsl.h
Normal file
122
documents/Tesselation_Tutorial/src/glsl.h
Normal file
@@ -0,0 +1,122 @@
|
||||
// GL ERROR CHECK
|
||||
#define CHECK_GL_ERROR() CheckGLError(__FILE__, __LINE__)
|
||||
// GL ERROR CHECK
|
||||
int CheckGLError(char *file, int line)
|
||||
{
|
||||
//return 0;
|
||||
GLenum glErr,glErr2;
|
||||
int retCode = 0;
|
||||
|
||||
glErr = glErr2 = glGetError();
|
||||
while (glErr != GL_NO_ERROR)
|
||||
{
|
||||
char* str1 = (char*)gluErrorString(glErr);
|
||||
if (str1)
|
||||
cout << "GL Error #" << glErr << "(" << str1 << ") " << " in File " << file << " at line: " << line << endl;
|
||||
else
|
||||
cout << "GL Error #" << glErr << " in File " << file << " at line: " << line << endl;
|
||||
retCode = 1;
|
||||
glErr = glGetError();
|
||||
}
|
||||
if (glErr2 != GL_NO_ERROR) while(1)Sleep(100);;
|
||||
|
||||
return 0;
|
||||
}
|
||||
///////////////////////////////////////////
|
||||
class Shader
|
||||
{
|
||||
public:
|
||||
Shader(std::string shadername){name=shadername;};
|
||||
void attach(int type,char* filename)
|
||||
{
|
||||
char* mem=read_file(filename);
|
||||
GLuint handle = glCreateShader(type);
|
||||
glShaderSource(handle, 1, (const GLchar**)(&mem), 0);
|
||||
CHECK_GL_ERROR();
|
||||
glCompileShader(handle);
|
||||
CHECK_GL_ERROR();
|
||||
|
||||
GLint compileSuccess=0;
|
||||
GLchar compilerSpew[256];
|
||||
|
||||
glGetShaderiv(handle, GL_COMPILE_STATUS, &compileSuccess);
|
||||
CHECK_GL_ERROR();
|
||||
if(!compileSuccess)
|
||||
{
|
||||
glGetShaderInfoLog(handle, sizeof(compilerSpew), 0, compilerSpew);
|
||||
printf("Shader %s\n%s\ncompileSuccess=%d\n",filename,compilerSpew,compileSuccess);
|
||||
CHECK_GL_ERROR();
|
||||
while(1);;
|
||||
}
|
||||
handles.push_back(handle);
|
||||
}
|
||||
void link()
|
||||
{
|
||||
program_handle = glCreateProgram();
|
||||
for (int i=0;i<handles.size();i++)
|
||||
{
|
||||
glAttachShader(program_handle, handles[i]);
|
||||
CHECK_GL_ERROR();
|
||||
}
|
||||
|
||||
glLinkProgram(program_handle);
|
||||
CHECK_GL_ERROR();
|
||||
|
||||
GLint linkSuccess;
|
||||
GLchar compilerSpew[256];
|
||||
glGetProgramiv(program_handle, GL_LINK_STATUS, &linkSuccess);
|
||||
if(!linkSuccess)
|
||||
{
|
||||
glGetProgramInfoLog(program_handle, sizeof(compilerSpew), 0, compilerSpew);
|
||||
printf("Shader Linker:\n%s\nlinkSuccess=%d\n",compilerSpew,linkSuccess);
|
||||
CHECK_GL_ERROR();
|
||||
while(1);;
|
||||
}
|
||||
printf("%s linked successful\n",name.c_str());
|
||||
CHECK_GL_ERROR();
|
||||
}
|
||||
void setUniformMatrix4fv(char* varname, GLsizei count, GLboolean transpose, GLfloat *value)
|
||||
{
|
||||
GLint loc = glGetUniformLocation(program_handle,varname);
|
||||
if (loc==-1)
|
||||
{
|
||||
printf("Variable \"%s\" in shader \"%s\" not found\n",varname,name.c_str());
|
||||
while(1);;
|
||||
};
|
||||
glUniformMatrix4fv(loc, count, transpose, value);
|
||||
CHECK_GL_ERROR();
|
||||
}
|
||||
void begin(void)
|
||||
{
|
||||
glUseProgram(program_handle);
|
||||
CHECK_GL_ERROR();
|
||||
}
|
||||
void end(void)
|
||||
{
|
||||
glUseProgram(0);
|
||||
CHECK_GL_ERROR();
|
||||
}
|
||||
private:
|
||||
std::vector<GLuint> handles;
|
||||
GLuint program_handle;
|
||||
std::string name;
|
||||
|
||||
char* read_file(char* name)
|
||||
{
|
||||
FILE * fp = fopen (name, "rb");
|
||||
|
||||
if (fp==0)
|
||||
{
|
||||
printf ("File %s NOT FOUND\n");
|
||||
while(1);;
|
||||
}
|
||||
fseek(fp, 0L, SEEK_END);
|
||||
int fsize = ftell(fp);
|
||||
fseek(fp, 0L, SEEK_SET);
|
||||
char* mem=(char*)malloc(fsize+1);
|
||||
for(int i=0;i<fsize+1;i++)mem[i]=0;
|
||||
fread (mem, 1, fsize, fp);
|
||||
fclose (fp);
|
||||
return mem;
|
||||
}
|
||||
};
|
||||
0
documents/preprocess.md
Executable file
0
documents/preprocess.md
Executable file
0
documents/program.dump
Executable file
0
documents/program.dump
Executable file
Reference in New Issue
Block a user