Showing
35 changed files
with
8403 additions
and
0 deletions
Kinect20.lib
0 → 100644
No preview for this file type
Kinect_Sample_Re.vcxproj
0 → 100644
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
3 | + <ItemGroup Label="ProjectConfigurations"> | ||
4 | + <ProjectConfiguration Include="Debug|Win32"> | ||
5 | + <Configuration>Debug</Configuration> | ||
6 | + <Platform>Win32</Platform> | ||
7 | + </ProjectConfiguration> | ||
8 | + <ProjectConfiguration Include="Debug|x64"> | ||
9 | + <Configuration>Debug</Configuration> | ||
10 | + <Platform>x64</Platform> | ||
11 | + </ProjectConfiguration> | ||
12 | + <ProjectConfiguration Include="Release|Win32"> | ||
13 | + <Configuration>Release</Configuration> | ||
14 | + <Platform>Win32</Platform> | ||
15 | + </ProjectConfiguration> | ||
16 | + <ProjectConfiguration Include="Release|x64"> | ||
17 | + <Configuration>Release</Configuration> | ||
18 | + <Platform>x64</Platform> | ||
19 | + </ProjectConfiguration> | ||
20 | + </ItemGroup> | ||
21 | + <PropertyGroup Label="Globals"> | ||
22 | + <ProjectGuid>{A2B5344E-B006-4B4E-A7E5-AACEFCD907EC}</ProjectGuid> | ||
23 | + <Keyword>Win32Proj</Keyword> | ||
24 | + <RootNamespace>Kinect_Sample_Re</RootNamespace> | ||
25 | + <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion> | ||
26 | + <ProjectName>gltest</ProjectName> | ||
27 | + </PropertyGroup> | ||
28 | + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
29 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | ||
30 | + <ConfigurationType>Application</ConfigurationType> | ||
31 | + <UseDebugLibraries>true</UseDebugLibraries> | ||
32 | + <PlatformToolset>v141</PlatformToolset> | ||
33 | + <CharacterSet>Unicode</CharacterSet> | ||
34 | + </PropertyGroup> | ||
35 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | ||
36 | + <ConfigurationType>Application</ConfigurationType> | ||
37 | + <UseDebugLibraries>true</UseDebugLibraries> | ||
38 | + <PlatformToolset>v141</PlatformToolset> | ||
39 | + <CharacterSet>Unicode</CharacterSet> | ||
40 | + </PropertyGroup> | ||
41 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | ||
42 | + <ConfigurationType>Application</ConfigurationType> | ||
43 | + <UseDebugLibraries>false</UseDebugLibraries> | ||
44 | + <PlatformToolset>v141</PlatformToolset> | ||
45 | + <WholeProgramOptimization>true</WholeProgramOptimization> | ||
46 | + <CharacterSet>Unicode</CharacterSet> | ||
47 | + </PropertyGroup> | ||
48 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | ||
49 | + <ConfigurationType>Application</ConfigurationType> | ||
50 | + <UseDebugLibraries>false</UseDebugLibraries> | ||
51 | + <PlatformToolset>v141</PlatformToolset> | ||
52 | + <WholeProgramOptimization>true</WholeProgramOptimization> | ||
53 | + <CharacterSet>Unicode</CharacterSet> | ||
54 | + </PropertyGroup> | ||
55 | + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
56 | + <ImportGroup Label="ExtensionSettings"> | ||
57 | + </ImportGroup> | ||
58 | + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
59 | + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
60 | + </ImportGroup> | ||
61 | + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> | ||
62 | + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
63 | + </ImportGroup> | ||
64 | + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
65 | + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
66 | + </ImportGroup> | ||
67 | + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> | ||
68 | + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
69 | + </ImportGroup> | ||
70 | + <PropertyGroup Label="UserMacros" /> | ||
71 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
72 | + <LinkIncremental>true</LinkIncremental> | ||
73 | + <IncludePath>C:\opencv\build\include;C:\Users\ljhoo_000\Documents\Visual Studio 2013\Projects\Kinect_Sample_Re\Kinect_Sample_Re\lib\freeglut\include;$(IncludePath)</IncludePath> | ||
74 | + <LibraryPath>C:\opencv\build\x64\vc10\lib;C:\Users\ljhoo_000\Documents\Visual Studio 2013\Projects\Kinect_Sample_Re\Kinect_Sample_Re\lib\freeglut\lib\x64;$(LibraryPath)</LibraryPath> | ||
75 | + </PropertyGroup> | ||
76 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
77 | + <LinkIncremental>true</LinkIncremental> | ||
78 | + <IncludePath>D:\과제\DMC\kinect_v2\Kinect_V2\Kinect_Sample_Re\gl;C:\Program Files\Microsoft SDKs\Kinect\v2.0-DevPreview1404\inc;C:\GitWork\Kinect_V2\Kinect_Sample_Re\Kinect_Sample_Re\lib\freeglut\include;$(IncludePath)</IncludePath> | ||
79 | + <LibraryPath>C:\Program Files\Microsoft SDKs\Kinect\v2.0-DevPreview1404\lib\x64;C:\GitWork\Kinect_V2\Kinect_Sample_Re\Kinect_Sample_Re\lib\freeglut\lib\x64;$(LibraryPath)</LibraryPath> | ||
80 | + </PropertyGroup> | ||
81 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
82 | + <LinkIncremental>false</LinkIncremental> | ||
83 | + </PropertyGroup> | ||
84 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
85 | + <LinkIncremental>false</LinkIncremental> | ||
86 | + </PropertyGroup> | ||
87 | + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
88 | + <ClCompile> | ||
89 | + <PrecompiledHeader> | ||
90 | + </PrecompiledHeader> | ||
91 | + <WarningLevel>Level3</WarningLevel> | ||
92 | + <Optimization>Disabled</Optimization> | ||
93 | + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
94 | + <SDLCheck>true</SDLCheck> | ||
95 | + </ClCompile> | ||
96 | + <Link> | ||
97 | + <SubSystem>Console</SubSystem> | ||
98 | + <GenerateDebugInformation>true</GenerateDebugInformation> | ||
99 | + </Link> | ||
100 | + </ItemDefinitionGroup> | ||
101 | + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
102 | + <ClCompile> | ||
103 | + <PrecompiledHeader> | ||
104 | + </PrecompiledHeader> | ||
105 | + <WarningLevel>Level3</WarningLevel> | ||
106 | + <Optimization>Disabled</Optimization> | ||
107 | + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINIGS</PreprocessorDefinitions> | ||
108 | + <SDLCheck>true</SDLCheck> | ||
109 | + </ClCompile> | ||
110 | + <Link> | ||
111 | + <SubSystem>Console</SubSystem> | ||
112 | + <GenerateDebugInformation>true</GenerateDebugInformation> | ||
113 | + <AdditionalDependencies>Kinect20.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
114 | + </Link> | ||
115 | + </ItemDefinitionGroup> | ||
116 | + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
117 | + <ClCompile> | ||
118 | + <WarningLevel>Level3</WarningLevel> | ||
119 | + <PrecompiledHeader> | ||
120 | + </PrecompiledHeader> | ||
121 | + <Optimization>MaxSpeed</Optimization> | ||
122 | + <FunctionLevelLinking>true</FunctionLevelLinking> | ||
123 | + <IntrinsicFunctions>true</IntrinsicFunctions> | ||
124 | + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
125 | + <SDLCheck>true</SDLCheck> | ||
126 | + </ClCompile> | ||
127 | + <Link> | ||
128 | + <SubSystem>Console</SubSystem> | ||
129 | + <GenerateDebugInformation>true</GenerateDebugInformation> | ||
130 | + <EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
131 | + <OptimizeReferences>true</OptimizeReferences> | ||
132 | + </Link> | ||
133 | + </ItemDefinitionGroup> | ||
134 | + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
135 | + <ClCompile> | ||
136 | + <WarningLevel>Level3</WarningLevel> | ||
137 | + <PrecompiledHeader> | ||
138 | + </PrecompiledHeader> | ||
139 | + <Optimization>MaxSpeed</Optimization> | ||
140 | + <FunctionLevelLinking>true</FunctionLevelLinking> | ||
141 | + <IntrinsicFunctions>true</IntrinsicFunctions> | ||
142 | + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
143 | + <SDLCheck>true</SDLCheck> | ||
144 | + </ClCompile> | ||
145 | + <Link> | ||
146 | + <SubSystem>Console</SubSystem> | ||
147 | + <GenerateDebugInformation>true</GenerateDebugInformation> | ||
148 | + <EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
149 | + <OptimizeReferences>true</OptimizeReferences> | ||
150 | + </Link> | ||
151 | + </ItemDefinitionGroup> | ||
152 | + <ItemGroup> | ||
153 | + <ClCompile Include="Renderer.cpp" /> | ||
154 | + </ItemGroup> | ||
155 | + <ItemGroup> | ||
156 | + <ClInclude Include="Renderer.h" /> | ||
157 | + </ItemGroup> | ||
158 | + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
159 | + <ImportGroup Label="ExtensionTargets"> | ||
160 | + </ImportGroup> | ||
161 | +</Project> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
Kinect_Sample_Re.vcxproj.filters
0 → 100644
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
3 | + <ItemGroup> | ||
4 | + <Filter Include="소스 파일"> | ||
5 | + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> | ||
6 | + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> | ||
7 | + </Filter> | ||
8 | + <Filter Include="헤더 파일"> | ||
9 | + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | ||
10 | + <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> | ||
11 | + </Filter> | ||
12 | + <Filter Include="리소스 파일"> | ||
13 | + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> | ||
14 | + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> | ||
15 | + </Filter> | ||
16 | + </ItemGroup> | ||
17 | + <ItemGroup> | ||
18 | + <ClCompile Include="Renderer.cpp"> | ||
19 | + <Filter>소스 파일</Filter> | ||
20 | + </ClCompile> | ||
21 | + </ItemGroup> | ||
22 | + <ItemGroup> | ||
23 | + <ClInclude Include="Renderer.h"> | ||
24 | + <Filter>헤더 파일</Filter> | ||
25 | + </ClInclude> | ||
26 | + </ItemGroup> | ||
27 | +</Project> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
Kinect_Sample_Re.vcxproj.user
0 → 100644
README.txt
0 → 100644
Renderer.h
0 → 100644
1 | +#pragma once | ||
2 | + | ||
3 | +#include <math.h> | ||
4 | +#include <iostream> | ||
5 | +#include <fstream> | ||
6 | +#include "gl/freeglut.h" // OpenGL header files | ||
7 | +#include <list> | ||
8 | +//#define TIME_CHECK_ | ||
9 | +#define DEPTH_CALIB_ | ||
10 | +#pragma warning(disable:4996) | ||
11 | +#define BLOCK 4 | ||
12 | +#define READ_SIZE 110404//5060//110404 | ||
13 | +#define scale 20 | ||
14 | +//#define TEST 14989 | ||
15 | +//#define STATIC_ | ||
16 | + | ||
17 | +using namespace std; | ||
18 | + | ||
19 | +struct Vertex{ | ||
20 | + float X; | ||
21 | + float Y; | ||
22 | + float Z; | ||
23 | + int index_1; | ||
24 | + int index_2; | ||
25 | + int index_3; | ||
26 | +}; | ||
27 | + | ||
28 | +// variables for GUI | ||
29 | +const float TRACKBALLSIZE = 0.8f; | ||
30 | +const int RENORMCOUNT = 97; | ||
31 | +//const int width = KinectBasic::nColorWidth; | ||
32 | +//const int height = KinectBasic::nColorHeight; | ||
33 | + | ||
34 | +GLint drag_state = 0; | ||
35 | +GLint button_state = 0; | ||
36 | + | ||
37 | +GLint rot_x = 0; | ||
38 | +GLint rot_y = 0; | ||
39 | +GLint trans_x = 0; | ||
40 | +GLint trans_y = 0; | ||
41 | +GLint trans_z = 0; | ||
42 | + | ||
43 | +int add_depth_flag = 0; | ||
44 | +int model_flag = 0; | ||
45 | +int depth_display_flag = 0; | ||
46 | +int geodesic_skel[23][5] = { 0 }; | ||
47 | + | ||
48 | +int side_status[50] = { 0 }; | ||
49 | + | ||
50 | +float quat[4] = {0}; | ||
51 | +float t[3] = {0}; | ||
52 | + | ||
53 | +Vertex skt[23]; | ||
54 | +bool bTracked = false; | ||
55 | +bool checkt = false; | ||
56 | +Vertex *vertex; | ||
57 | +Vertex *vertex_color; | ||
58 | + | ||
59 | +bool recheck; | ||
60 | + | ||
61 | +// variables for display OpenGL based point viewer | ||
62 | +int dispWindowIndex = 0; | ||
63 | +GLuint dispBindIndex = 0; | ||
64 | +const float dispPointSize = 2.0f; | ||
65 | + | ||
66 | +// variables for display text | ||
67 | +string dispString = ""; | ||
68 | +const string dispStringInit = "Depth Threshold: D\nInfrared Threshold: I\nNonlocal Means Filter: N\nPick BodyIndex: P\nAccumulate Mode: A\nSelect Mode: C,B(select)\nSave: S\nReset View: R\nQuit: ESC"; | ||
69 | +string frameRate; | ||
70 | + | ||
71 | +// HANDLE hMutex; | ||
72 | +//KinectBasic kinect; | ||
73 | + | ||
74 | +// functions for GUIs | ||
75 | +void InitializeWindow(int argc, char* argv[]); | ||
76 | + | ||
77 | +// high-level functions for GUI | ||
78 | +void draw_center(); | ||
79 | +void idle(); | ||
80 | +void display(); | ||
81 | +void close(); | ||
82 | +void special(int, int, int) {} | ||
83 | +void keyboard(unsigned char, int, int); | ||
84 | +void mouse(int, int, int, int); | ||
85 | +void reshape(int, int); | ||
86 | +void motion(int, int); | ||
87 | + | ||
88 | + | ||
89 | +// basic functions for computation/GUI | ||
90 | +// trackball codes were imported from those of Gavin Bell | ||
91 | +// which appeared in SIGGRAPH '88 | ||
92 | +void vzero(float*); | ||
93 | +void vset(float*, float, float, float); | ||
94 | +void vsub(const float*, const float*, float*); | ||
95 | +void vcopy(const float*, float*); | ||
96 | +void vcross(const float *v1, const float *v2, float *cross); | ||
97 | +float vlength(const float *v); | ||
98 | +void vscale(float *v, float div); | ||
99 | +void vnormal(float *v); | ||
100 | +float vdot(const float *v1, const float *v2); | ||
101 | +void vadd(const float *src1, const float *src2, float *dst); | ||
102 | + | ||
103 | +void trackball(float q[4], float, float, float, float); | ||
104 | +//void add_quats(float*, float*, float*); | ||
105 | +void axis_to_quat(float a[3], float phi, float q[4]); | ||
106 | +void normalize_quat(float q[4]); | ||
107 | +float tb_project_to_sphere(float, float, float); | ||
108 | +void build_rotmatrix(float m[4][4], float q[4]); | ||
109 | +void Reader(); | ||
110 | +void DrawObj(); | ||
111 | +void DrawMeshObj(); | ||
112 | +void Setskt(); | ||
113 | + | ||
114 | +//CameraSpacePoint m_SpacePoint[JointType::JointType_Count]; | ||
115 | +void Track(); |
a.out
0 → 100755
No preview for this file type
apple.obj
0 → 100644
This diff could not be displayed because it is too large.
applef2.txt
0 → 100644
This diff could not be displayed because it is too large.
applet.bmp
0 → 100644
This file is too large to display.
applet.txt
0 → 100644
This diff could not be displayed because it is too large.
freeglut.dll
0 → 100644
No preview for this file type
freeglut.lib
0 → 100644
No preview for this file type
gl/freeglut.h
0 → 100644
1 | +#ifndef __FREEGLUT_H__ | ||
2 | +#define __FREEGLUT_H__ | ||
3 | + | ||
4 | +/* | ||
5 | + * freeglut.h | ||
6 | + * | ||
7 | + * The freeglut library include file | ||
8 | + * | ||
9 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
10 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
11 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
12 | + * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
13 | + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
14 | + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
15 | + */ | ||
16 | + | ||
17 | +#include "freeglut_std.h" | ||
18 | +#include "freeglut_ext.h" | ||
19 | + | ||
20 | +/*** END OF FILE ***/ | ||
21 | + | ||
22 | +#endif /* __FREEGLUT_H__ */ |
gl/freeglut_ext.h
0 → 100644
1 | +#ifndef __FREEGLUT_EXT_H__ | ||
2 | +#define __FREEGLUT_EXT_H__ | ||
3 | + | ||
4 | +/* | ||
5 | + * freeglut_ext.h | ||
6 | + * | ||
7 | + * The non-GLUT-compatible extensions to the freeglut library include file | ||
8 | + * | ||
9 | + * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. | ||
10 | + * Written by Pawel W. Olszta, <olszta@sourceforge.net> | ||
11 | + * Creation date: Thu Dec 2 1999 | ||
12 | + * | ||
13 | + * Permission is hereby granted, free of charge, to any person obtaining a | ||
14 | + * copy of this software and associated documentation files (the "Software"), | ||
15 | + * to deal in the Software without restriction, including without limitation | ||
16 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
17 | + * and/or sell copies of the Software, and to permit persons to whom the | ||
18 | + * Software is furnished to do so, subject to the following conditions: | ||
19 | + * | ||
20 | + * The above copyright notice and this permission notice shall be included | ||
21 | + * in all copies or substantial portions of the Software. | ||
22 | + * | ||
23 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
24 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
25 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
26 | + * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
27 | + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
28 | + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
29 | + */ | ||
30 | + | ||
31 | +#ifdef __cplusplus | ||
32 | + extern "C" { | ||
33 | +#endif | ||
34 | + | ||
35 | +/* | ||
36 | + * Additional GLUT Key definitions for the Special key function | ||
37 | + */ | ||
38 | +#define GLUT_KEY_NUM_LOCK 0x006D | ||
39 | +#define GLUT_KEY_BEGIN 0x006E | ||
40 | +#define GLUT_KEY_DELETE 0x006F | ||
41 | +#define GLUT_KEY_SHIFT_L 0x0070 | ||
42 | +#define GLUT_KEY_SHIFT_R 0x0071 | ||
43 | +#define GLUT_KEY_CTRL_L 0x0072 | ||
44 | +#define GLUT_KEY_CTRL_R 0x0073 | ||
45 | +#define GLUT_KEY_ALT_L 0x0074 | ||
46 | +#define GLUT_KEY_ALT_R 0x0075 | ||
47 | + | ||
48 | +/* | ||
49 | + * GLUT API Extension macro definitions -- behaviour when the user clicks on an "x" to close a window | ||
50 | + */ | ||
51 | +#define GLUT_ACTION_EXIT 0 | ||
52 | +#define GLUT_ACTION_GLUTMAINLOOP_RETURNS 1 | ||
53 | +#define GLUT_ACTION_CONTINUE_EXECUTION 2 | ||
54 | + | ||
55 | +/* | ||
56 | + * Create a new rendering context when the user opens a new window? | ||
57 | + */ | ||
58 | +#define GLUT_CREATE_NEW_CONTEXT 0 | ||
59 | +#define GLUT_USE_CURRENT_CONTEXT 1 | ||
60 | + | ||
61 | +/* | ||
62 | + * Direct/Indirect rendering context options (has meaning only in Unix/X11) | ||
63 | + */ | ||
64 | +#define GLUT_FORCE_INDIRECT_CONTEXT 0 | ||
65 | +#define GLUT_ALLOW_DIRECT_CONTEXT 1 | ||
66 | +#define GLUT_TRY_DIRECT_CONTEXT 2 | ||
67 | +#define GLUT_FORCE_DIRECT_CONTEXT 3 | ||
68 | + | ||
69 | +/* | ||
70 | + * GLUT API Extension macro definitions -- the glutGet parameters | ||
71 | + */ | ||
72 | +#define GLUT_INIT_STATE 0x007C | ||
73 | + | ||
74 | +#define GLUT_ACTION_ON_WINDOW_CLOSE 0x01F9 | ||
75 | + | ||
76 | +#define GLUT_WINDOW_BORDER_WIDTH 0x01FA | ||
77 | +#define GLUT_WINDOW_HEADER_HEIGHT 0x01FB | ||
78 | + | ||
79 | +#define GLUT_VERSION 0x01FC | ||
80 | + | ||
81 | +#define GLUT_RENDERING_CONTEXT 0x01FD | ||
82 | +#define GLUT_DIRECT_RENDERING 0x01FE | ||
83 | + | ||
84 | +#define GLUT_FULL_SCREEN 0x01FF | ||
85 | + | ||
86 | +/* | ||
87 | + * New tokens for glutInitDisplayMode. | ||
88 | + * Only one GLUT_AUXn bit may be used at a time. | ||
89 | + * Value 0x0400 is defined in OpenGLUT. | ||
90 | + */ | ||
91 | +#define GLUT_AUX 0x1000 | ||
92 | + | ||
93 | +#define GLUT_AUX1 0x1000 | ||
94 | +#define GLUT_AUX2 0x2000 | ||
95 | +#define GLUT_AUX3 0x4000 | ||
96 | +#define GLUT_AUX4 0x8000 | ||
97 | + | ||
98 | +/* | ||
99 | + * Context-related flags, see freeglut_state.c | ||
100 | + */ | ||
101 | +#define GLUT_INIT_MAJOR_VERSION 0x0200 | ||
102 | +#define GLUT_INIT_MINOR_VERSION 0x0201 | ||
103 | +#define GLUT_INIT_FLAGS 0x0202 | ||
104 | +#define GLUT_INIT_PROFILE 0x0203 | ||
105 | + | ||
106 | +/* | ||
107 | + * Flags for glutInitContextFlags, see freeglut_init.c | ||
108 | + */ | ||
109 | +#define GLUT_DEBUG 0x0001 | ||
110 | +#define GLUT_FORWARD_COMPATIBLE 0x0002 | ||
111 | + | ||
112 | + | ||
113 | +/* | ||
114 | + * Flags for glutInitContextProfile, see freeglut_init.c | ||
115 | + */ | ||
116 | +#define GLUT_CORE_PROFILE 0x0001 | ||
117 | +#define GLUT_COMPATIBILITY_PROFILE 0x0002 | ||
118 | + | ||
119 | +/* | ||
120 | + * Process loop function, see freeglut_main.c | ||
121 | + */ | ||
122 | +FGAPI void FGAPIENTRY glutMainLoopEvent( void ); | ||
123 | +FGAPI void FGAPIENTRY glutLeaveMainLoop( void ); | ||
124 | +FGAPI void FGAPIENTRY glutExit ( void ); | ||
125 | + | ||
126 | +/* | ||
127 | + * Window management functions, see freeglut_window.c | ||
128 | + */ | ||
129 | +FGAPI void FGAPIENTRY glutFullScreenToggle( void ); | ||
130 | +FGAPI void FGAPIENTRY glutLeaveFullScreen( void ); | ||
131 | + | ||
132 | +/* | ||
133 | + * Window-specific callback functions, see freeglut_callbacks.c | ||
134 | + */ | ||
135 | +FGAPI void FGAPIENTRY glutMouseWheelFunc( void (* callback)( int, int, int, int ) ); | ||
136 | +FGAPI void FGAPIENTRY glutCloseFunc( void (* callback)( void ) ); | ||
137 | +FGAPI void FGAPIENTRY glutWMCloseFunc( void (* callback)( void ) ); | ||
138 | +/* A. Donev: Also a destruction callback for menus */ | ||
139 | +FGAPI void FGAPIENTRY glutMenuDestroyFunc( void (* callback)( void ) ); | ||
140 | + | ||
141 | +/* | ||
142 | + * State setting and retrieval functions, see freeglut_state.c | ||
143 | + */ | ||
144 | +FGAPI void FGAPIENTRY glutSetOption ( GLenum option_flag, int value ); | ||
145 | +FGAPI int * FGAPIENTRY glutGetModeValues(GLenum mode, int * size); | ||
146 | +/* A.Donev: User-data manipulation */ | ||
147 | +FGAPI void* FGAPIENTRY glutGetWindowData( void ); | ||
148 | +FGAPI void FGAPIENTRY glutSetWindowData(void* data); | ||
149 | +FGAPI void* FGAPIENTRY glutGetMenuData( void ); | ||
150 | +FGAPI void FGAPIENTRY glutSetMenuData(void* data); | ||
151 | + | ||
152 | +/* | ||
153 | + * Font stuff, see freeglut_font.c | ||
154 | + */ | ||
155 | +FGAPI int FGAPIENTRY glutBitmapHeight( void* font ); | ||
156 | +FGAPI GLfloat FGAPIENTRY glutStrokeHeight( void* font ); | ||
157 | +FGAPI void FGAPIENTRY glutBitmapString( void* font, const unsigned char *string ); | ||
158 | +FGAPI void FGAPIENTRY glutStrokeString( void* font, const unsigned char *string ); | ||
159 | + | ||
160 | +/* | ||
161 | + * Geometry functions, see freeglut_geometry.c | ||
162 | + */ | ||
163 | +FGAPI void FGAPIENTRY glutWireRhombicDodecahedron( void ); | ||
164 | +FGAPI void FGAPIENTRY glutSolidRhombicDodecahedron( void ); | ||
165 | +FGAPI void FGAPIENTRY glutWireSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale ); | ||
166 | +FGAPI void FGAPIENTRY glutSolidSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale ); | ||
167 | +FGAPI void FGAPIENTRY glutWireCylinder( GLdouble radius, GLdouble height, GLint slices, GLint stacks); | ||
168 | +FGAPI void FGAPIENTRY glutSolidCylinder( GLdouble radius, GLdouble height, GLint slices, GLint stacks); | ||
169 | + | ||
170 | +/* | ||
171 | + * Extension functions, see freeglut_ext.c | ||
172 | + */ | ||
173 | +typedef void (*GLUTproc)(); | ||
174 | +FGAPI GLUTproc FGAPIENTRY glutGetProcAddress( const char *procName ); | ||
175 | + | ||
176 | +/* | ||
177 | + * Multi-touch/multi-pointer extensions | ||
178 | + */ | ||
179 | + | ||
180 | +#define GLUT_HAS_MULTI 1 | ||
181 | + | ||
182 | +FGAPI void FGAPIENTRY glutMultiEntryFunc( void (* callback)( int, int ) ); | ||
183 | +FGAPI void FGAPIENTRY glutMultiButtonFunc( void (* callback)( int, int, int, int, int ) ); | ||
184 | +FGAPI void FGAPIENTRY glutMultiMotionFunc( void (* callback)( int, int, int ) ); | ||
185 | +FGAPI void FGAPIENTRY glutMultiPassiveFunc( void (* callback)( int, int, int ) ); | ||
186 | + | ||
187 | +/* | ||
188 | + * Joystick functions, see freeglut_joystick.c | ||
189 | + */ | ||
190 | +/* USE OF THESE FUNCTIONS IS DEPRECATED !!!!! */ | ||
191 | +/* If you have a serious need for these functions in your application, please either | ||
192 | + * contact the "freeglut" developer community at freeglut-developer@lists.sourceforge.net, | ||
193 | + * switch to the OpenGLUT library, or else port your joystick functionality over to PLIB's | ||
194 | + * "js" library. | ||
195 | + */ | ||
196 | +int glutJoystickGetNumAxes( int ident ); | ||
197 | +int glutJoystickGetNumButtons( int ident ); | ||
198 | +int glutJoystickNotWorking( int ident ); | ||
199 | +float glutJoystickGetDeadBand( int ident, int axis ); | ||
200 | +void glutJoystickSetDeadBand( int ident, int axis, float db ); | ||
201 | +float glutJoystickGetSaturation( int ident, int axis ); | ||
202 | +void glutJoystickSetSaturation( int ident, int axis, float st ); | ||
203 | +void glutJoystickSetMinRange( int ident, float *axes ); | ||
204 | +void glutJoystickSetMaxRange( int ident, float *axes ); | ||
205 | +void glutJoystickSetCenter( int ident, float *axes ); | ||
206 | +void glutJoystickGetMinRange( int ident, float *axes ); | ||
207 | +void glutJoystickGetMaxRange( int ident, float *axes ); | ||
208 | +void glutJoystickGetCenter( int ident, float *axes ); | ||
209 | + | ||
210 | +/* | ||
211 | + * Initialization functions, see freeglut_init.c | ||
212 | + */ | ||
213 | +FGAPI void FGAPIENTRY glutInitContextVersion( int majorVersion, int minorVersion ); | ||
214 | +FGAPI void FGAPIENTRY glutInitContextFlags( int flags ); | ||
215 | +FGAPI void FGAPIENTRY glutInitContextProfile( int profile ); | ||
216 | + | ||
217 | +/* to get the typedef for va_list */ | ||
218 | +#include <stdarg.h> | ||
219 | + | ||
220 | +FGAPI void FGAPIENTRY glutInitErrorFunc( void (* vError)( const char *fmt, va_list ap ) ); | ||
221 | +FGAPI void FGAPIENTRY glutInitWarningFunc( void (* vWarning)( const char *fmt, va_list ap ) ); | ||
222 | + | ||
223 | +/* | ||
224 | + * GLUT API macro definitions -- the display mode definitions | ||
225 | + */ | ||
226 | +#define GLUT_CAPTIONLESS 0x0400 | ||
227 | +#define GLUT_BORDERLESS 0x0800 | ||
228 | +#define GLUT_SRGB 0x1000 | ||
229 | + | ||
230 | +#ifdef __cplusplus | ||
231 | + } | ||
232 | +#endif | ||
233 | + | ||
234 | +/*** END OF FILE ***/ | ||
235 | + | ||
236 | +#endif /* __FREEGLUT_EXT_H__ */ |
gl/freeglut_std.h
0 → 100644
1 | +#ifndef __FREEGLUT_STD_H__ | ||
2 | +#define __FREEGLUT_STD_H__ | ||
3 | + | ||
4 | +/* | ||
5 | + * freeglut_std.h | ||
6 | + * | ||
7 | + * The GLUT-compatible part of the freeglut library include file | ||
8 | + * | ||
9 | + * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. | ||
10 | + * Written by Pawel W. Olszta, <olszta@sourceforge.net> | ||
11 | + * Creation date: Thu Dec 2 1999 | ||
12 | + * | ||
13 | + * Permission is hereby granted, free of charge, to any person obtaining a | ||
14 | + * copy of this software and associated documentation files (the "Software"), | ||
15 | + * to deal in the Software without restriction, including without limitation | ||
16 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
17 | + * and/or sell copies of the Software, and to permit persons to whom the | ||
18 | + * Software is furnished to do so, subject to the following conditions: | ||
19 | + * | ||
20 | + * The above copyright notice and this permission notice shall be included | ||
21 | + * in all copies or substantial portions of the Software. | ||
22 | + * | ||
23 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
24 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
25 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
26 | + * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
27 | + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
28 | + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
29 | + */ | ||
30 | + | ||
31 | +#ifdef __cplusplus | ||
32 | + extern "C" { | ||
33 | +#endif | ||
34 | + | ||
35 | +/* | ||
36 | + * Under windows, we have to differentiate between static and dynamic libraries | ||
37 | + */ | ||
38 | +#ifdef _WIN32 | ||
39 | +/* #pragma may not be supported by some compilers. | ||
40 | + * Discussion by FreeGLUT developers suggests that | ||
41 | + * Visual C++ specific code involving pragmas may | ||
42 | + * need to move to a separate header. 24th Dec 2003 | ||
43 | + */ | ||
44 | + | ||
45 | +/* Define FREEGLUT_LIB_PRAGMAS to 1 to include library | ||
46 | + * pragmas or to 0 to exclude library pragmas. | ||
47 | + * The default behavior depends on the compiler/platform. | ||
48 | + */ | ||
49 | +# ifndef FREEGLUT_LIB_PRAGMAS | ||
50 | +# if ( defined(_MSC_VER) || defined(__WATCOMC__) ) && !defined(_WIN32_WCE) | ||
51 | +# define FREEGLUT_LIB_PRAGMAS 1 | ||
52 | +# else | ||
53 | +# define FREEGLUT_LIB_PRAGMAS 0 | ||
54 | +# endif | ||
55 | +# endif | ||
56 | + | ||
57 | +# ifndef WIN32_LEAN_AND_MEAN | ||
58 | +# define WIN32_LEAN_AND_MEAN 1 | ||
59 | +# endif | ||
60 | +# ifndef NOMINMAX | ||
61 | +# define NOMINMAX | ||
62 | +# endif | ||
63 | +# include <windows.h> | ||
64 | + | ||
65 | +/* Windows static library */ | ||
66 | +# ifdef FREEGLUT_STATIC | ||
67 | + | ||
68 | +# define FGAPI | ||
69 | +# define FGAPIENTRY | ||
70 | + | ||
71 | + /* Link with Win32 static freeglut lib */ | ||
72 | +# if FREEGLUT_LIB_PRAGMAS | ||
73 | +# pragma comment (lib, "freeglut_static.lib") | ||
74 | +# endif | ||
75 | + | ||
76 | +/* Windows shared library (DLL) */ | ||
77 | +# else | ||
78 | + | ||
79 | +# define FGAPIENTRY __stdcall | ||
80 | +# if defined(FREEGLUT_EXPORTS) | ||
81 | +# define FGAPI __declspec(dllexport) | ||
82 | +# else | ||
83 | +# define FGAPI __declspec(dllimport) | ||
84 | + | ||
85 | + /* Link with Win32 shared freeglut lib */ | ||
86 | +# if FREEGLUT_LIB_PRAGMAS | ||
87 | +# pragma comment (lib, "freeglut.lib") | ||
88 | +# endif | ||
89 | + | ||
90 | +# endif | ||
91 | + | ||
92 | +# endif | ||
93 | + | ||
94 | +/* Drag in other Windows libraries as required by FreeGLUT */ | ||
95 | +# if FREEGLUT_LIB_PRAGMAS | ||
96 | +# pragma comment (lib, "glu32.lib") /* link OpenGL Utility lib */ | ||
97 | +# pragma comment (lib, "opengl32.lib") /* link Microsoft OpenGL lib */ | ||
98 | +# pragma comment (lib, "gdi32.lib") /* link Windows GDI lib */ | ||
99 | +# pragma comment (lib, "winmm.lib") /* link Windows MultiMedia lib */ | ||
100 | +# pragma comment (lib, "user32.lib") /* link Windows user lib */ | ||
101 | +# endif | ||
102 | + | ||
103 | +#else | ||
104 | + | ||
105 | +/* Non-Windows definition of FGAPI and FGAPIENTRY */ | ||
106 | +# define FGAPI | ||
107 | +# define FGAPIENTRY | ||
108 | + | ||
109 | +#endif | ||
110 | + | ||
111 | +/* | ||
112 | + * The freeglut and GLUT API versions | ||
113 | + */ | ||
114 | +#define FREEGLUT 1 | ||
115 | +#define GLUT_API_VERSION 4 | ||
116 | +#define FREEGLUT_VERSION_2_0 1 | ||
117 | +#define GLUT_XLIB_IMPLEMENTATION 13 | ||
118 | + | ||
119 | +/* | ||
120 | + * Always include OpenGL and GLU headers | ||
121 | + */ | ||
122 | +#include <GL/gl.h> | ||
123 | +#include <GL/glu.h> | ||
124 | + | ||
125 | +/* | ||
126 | + * GLUT API macro definitions -- the special key codes: | ||
127 | + */ | ||
128 | +#define GLUT_KEY_F1 0x0001 | ||
129 | +#define GLUT_KEY_F2 0x0002 | ||
130 | +#define GLUT_KEY_F3 0x0003 | ||
131 | +#define GLUT_KEY_F4 0x0004 | ||
132 | +#define GLUT_KEY_F5 0x0005 | ||
133 | +#define GLUT_KEY_F6 0x0006 | ||
134 | +#define GLUT_KEY_F7 0x0007 | ||
135 | +#define GLUT_KEY_F8 0x0008 | ||
136 | +#define GLUT_KEY_F9 0x0009 | ||
137 | +#define GLUT_KEY_F10 0x000A | ||
138 | +#define GLUT_KEY_F11 0x000B | ||
139 | +#define GLUT_KEY_F12 0x000C | ||
140 | +#define GLUT_KEY_LEFT 0x0064 | ||
141 | +#define GLUT_KEY_UP 0x0065 | ||
142 | +#define GLUT_KEY_RIGHT 0x0066 | ||
143 | +#define GLUT_KEY_DOWN 0x0067 | ||
144 | +#define GLUT_KEY_PAGE_UP 0x0068 | ||
145 | +#define GLUT_KEY_PAGE_DOWN 0x0069 | ||
146 | +#define GLUT_KEY_HOME 0x006A | ||
147 | +#define GLUT_KEY_END 0x006B | ||
148 | +#define GLUT_KEY_INSERT 0x006C | ||
149 | + | ||
150 | +/* | ||
151 | + * GLUT API macro definitions -- mouse state definitions | ||
152 | + */ | ||
153 | +#define GLUT_LEFT_BUTTON 0x0000 | ||
154 | +#define GLUT_MIDDLE_BUTTON 0x0001 | ||
155 | +#define GLUT_RIGHT_BUTTON 0x0002 | ||
156 | +#define GLUT_DOWN 0x0000 | ||
157 | +#define GLUT_UP 0x0001 | ||
158 | +#define GLUT_LEFT 0x0000 | ||
159 | +#define GLUT_ENTERED 0x0001 | ||
160 | + | ||
161 | +/* | ||
162 | + * GLUT API macro definitions -- the display mode definitions | ||
163 | + */ | ||
164 | +#define GLUT_RGB 0x0000 | ||
165 | +#define GLUT_RGBA 0x0000 | ||
166 | +#define GLUT_INDEX 0x0001 | ||
167 | +#define GLUT_SINGLE 0x0000 | ||
168 | +#define GLUT_DOUBLE 0x0002 | ||
169 | +#define GLUT_ACCUM 0x0004 | ||
170 | +#define GLUT_ALPHA 0x0008 | ||
171 | +#define GLUT_DEPTH 0x0010 | ||
172 | +#define GLUT_STENCIL 0x0020 | ||
173 | +#define GLUT_MULTISAMPLE 0x0080 | ||
174 | +#define GLUT_STEREO 0x0100 | ||
175 | +#define GLUT_LUMINANCE 0x0200 | ||
176 | + | ||
177 | +/* | ||
178 | + * GLUT API macro definitions -- windows and menu related definitions | ||
179 | + */ | ||
180 | +#define GLUT_MENU_NOT_IN_USE 0x0000 | ||
181 | +#define GLUT_MENU_IN_USE 0x0001 | ||
182 | +#define GLUT_NOT_VISIBLE 0x0000 | ||
183 | +#define GLUT_VISIBLE 0x0001 | ||
184 | +#define GLUT_HIDDEN 0x0000 | ||
185 | +#define GLUT_FULLY_RETAINED 0x0001 | ||
186 | +#define GLUT_PARTIALLY_RETAINED 0x0002 | ||
187 | +#define GLUT_FULLY_COVERED 0x0003 | ||
188 | + | ||
189 | +/* | ||
190 | + * GLUT API macro definitions -- fonts definitions | ||
191 | + * | ||
192 | + * Steve Baker suggested to make it binary compatible with GLUT: | ||
193 | + */ | ||
194 | +#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__WATCOMC__) | ||
195 | +# define GLUT_STROKE_ROMAN ((void *)0x0000) | ||
196 | +# define GLUT_STROKE_MONO_ROMAN ((void *)0x0001) | ||
197 | +# define GLUT_BITMAP_9_BY_15 ((void *)0x0002) | ||
198 | +# define GLUT_BITMAP_8_BY_13 ((void *)0x0003) | ||
199 | +# define GLUT_BITMAP_TIMES_ROMAN_10 ((void *)0x0004) | ||
200 | +# define GLUT_BITMAP_TIMES_ROMAN_24 ((void *)0x0005) | ||
201 | +# define GLUT_BITMAP_HELVETICA_10 ((void *)0x0006) | ||
202 | +# define GLUT_BITMAP_HELVETICA_12 ((void *)0x0007) | ||
203 | +# define GLUT_BITMAP_HELVETICA_18 ((void *)0x0008) | ||
204 | +#else | ||
205 | + /* | ||
206 | + * I don't really know if it's a good idea... But here it goes: | ||
207 | + */ | ||
208 | + extern void* glutStrokeRoman; | ||
209 | + extern void* glutStrokeMonoRoman; | ||
210 | + extern void* glutBitmap9By15; | ||
211 | + extern void* glutBitmap8By13; | ||
212 | + extern void* glutBitmapTimesRoman10; | ||
213 | + extern void* glutBitmapTimesRoman24; | ||
214 | + extern void* glutBitmapHelvetica10; | ||
215 | + extern void* glutBitmapHelvetica12; | ||
216 | + extern void* glutBitmapHelvetica18; | ||
217 | + | ||
218 | + /* | ||
219 | + * Those pointers will be used by following definitions: | ||
220 | + */ | ||
221 | +# define GLUT_STROKE_ROMAN ((void *) &glutStrokeRoman) | ||
222 | +# define GLUT_STROKE_MONO_ROMAN ((void *) &glutStrokeMonoRoman) | ||
223 | +# define GLUT_BITMAP_9_BY_15 ((void *) &glutBitmap9By15) | ||
224 | +# define GLUT_BITMAP_8_BY_13 ((void *) &glutBitmap8By13) | ||
225 | +# define GLUT_BITMAP_TIMES_ROMAN_10 ((void *) &glutBitmapTimesRoman10) | ||
226 | +# define GLUT_BITMAP_TIMES_ROMAN_24 ((void *) &glutBitmapTimesRoman24) | ||
227 | +# define GLUT_BITMAP_HELVETICA_10 ((void *) &glutBitmapHelvetica10) | ||
228 | +# define GLUT_BITMAP_HELVETICA_12 ((void *) &glutBitmapHelvetica12) | ||
229 | +# define GLUT_BITMAP_HELVETICA_18 ((void *) &glutBitmapHelvetica18) | ||
230 | +#endif | ||
231 | + | ||
232 | +/* | ||
233 | + * GLUT API macro definitions -- the glutGet parameters | ||
234 | + */ | ||
235 | +#define GLUT_WINDOW_X 0x0064 | ||
236 | +#define GLUT_WINDOW_Y 0x0065 | ||
237 | +#define GLUT_WINDOW_WIDTH 0x0066 | ||
238 | +#define GLUT_WINDOW_HEIGHT 0x0067 | ||
239 | +#define GLUT_WINDOW_BUFFER_SIZE 0x0068 | ||
240 | +#define GLUT_WINDOW_STENCIL_SIZE 0x0069 | ||
241 | +#define GLUT_WINDOW_DEPTH_SIZE 0x006A | ||
242 | +#define GLUT_WINDOW_RED_SIZE 0x006B | ||
243 | +#define GLUT_WINDOW_GREEN_SIZE 0x006C | ||
244 | +#define GLUT_WINDOW_BLUE_SIZE 0x006D | ||
245 | +#define GLUT_WINDOW_ALPHA_SIZE 0x006E | ||
246 | +#define GLUT_WINDOW_ACCUM_RED_SIZE 0x006F | ||
247 | +#define GLUT_WINDOW_ACCUM_GREEN_SIZE 0x0070 | ||
248 | +#define GLUT_WINDOW_ACCUM_BLUE_SIZE 0x0071 | ||
249 | +#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 0x0072 | ||
250 | +#define GLUT_WINDOW_DOUBLEBUFFER 0x0073 | ||
251 | +#define GLUT_WINDOW_RGBA 0x0074 | ||
252 | +#define GLUT_WINDOW_PARENT 0x0075 | ||
253 | +#define GLUT_WINDOW_NUM_CHILDREN 0x0076 | ||
254 | +#define GLUT_WINDOW_COLORMAP_SIZE 0x0077 | ||
255 | +#define GLUT_WINDOW_NUM_SAMPLES 0x0078 | ||
256 | +#define GLUT_WINDOW_STEREO 0x0079 | ||
257 | +#define GLUT_WINDOW_CURSOR 0x007A | ||
258 | + | ||
259 | +#define GLUT_SCREEN_WIDTH 0x00C8 | ||
260 | +#define GLUT_SCREEN_HEIGHT 0x00C9 | ||
261 | +#define GLUT_SCREEN_WIDTH_MM 0x00CA | ||
262 | +#define GLUT_SCREEN_HEIGHT_MM 0x00CB | ||
263 | +#define GLUT_MENU_NUM_ITEMS 0x012C | ||
264 | +#define GLUT_DISPLAY_MODE_POSSIBLE 0x0190 | ||
265 | +#define GLUT_INIT_WINDOW_X 0x01F4 | ||
266 | +#define GLUT_INIT_WINDOW_Y 0x01F5 | ||
267 | +#define GLUT_INIT_WINDOW_WIDTH 0x01F6 | ||
268 | +#define GLUT_INIT_WINDOW_HEIGHT 0x01F7 | ||
269 | +#define GLUT_INIT_DISPLAY_MODE 0x01F8 | ||
270 | +#define GLUT_ELAPSED_TIME 0x02BC | ||
271 | +#define GLUT_WINDOW_FORMAT_ID 0x007B | ||
272 | + | ||
273 | +/* | ||
274 | + * GLUT API macro definitions -- the glutDeviceGet parameters | ||
275 | + */ | ||
276 | +#define GLUT_HAS_KEYBOARD 0x0258 | ||
277 | +#define GLUT_HAS_MOUSE 0x0259 | ||
278 | +#define GLUT_HAS_SPACEBALL 0x025A | ||
279 | +#define GLUT_HAS_DIAL_AND_BUTTON_BOX 0x025B | ||
280 | +#define GLUT_HAS_TABLET 0x025C | ||
281 | +#define GLUT_NUM_MOUSE_BUTTONS 0x025D | ||
282 | +#define GLUT_NUM_SPACEBALL_BUTTONS 0x025E | ||
283 | +#define GLUT_NUM_BUTTON_BOX_BUTTONS 0x025F | ||
284 | +#define GLUT_NUM_DIALS 0x0260 | ||
285 | +#define GLUT_NUM_TABLET_BUTTONS 0x0261 | ||
286 | +#define GLUT_DEVICE_IGNORE_KEY_REPEAT 0x0262 | ||
287 | +#define GLUT_DEVICE_KEY_REPEAT 0x0263 | ||
288 | +#define GLUT_HAS_JOYSTICK 0x0264 | ||
289 | +#define GLUT_OWNS_JOYSTICK 0x0265 | ||
290 | +#define GLUT_JOYSTICK_BUTTONS 0x0266 | ||
291 | +#define GLUT_JOYSTICK_AXES 0x0267 | ||
292 | +#define GLUT_JOYSTICK_POLL_RATE 0x0268 | ||
293 | + | ||
294 | +/* | ||
295 | + * GLUT API macro definitions -- the glutLayerGet parameters | ||
296 | + */ | ||
297 | +#define GLUT_OVERLAY_POSSIBLE 0x0320 | ||
298 | +#define GLUT_LAYER_IN_USE 0x0321 | ||
299 | +#define GLUT_HAS_OVERLAY 0x0322 | ||
300 | +#define GLUT_TRANSPARENT_INDEX 0x0323 | ||
301 | +#define GLUT_NORMAL_DAMAGED 0x0324 | ||
302 | +#define GLUT_OVERLAY_DAMAGED 0x0325 | ||
303 | + | ||
304 | +/* | ||
305 | + * GLUT API macro definitions -- the glutVideoResizeGet parameters | ||
306 | + */ | ||
307 | +#define GLUT_VIDEO_RESIZE_POSSIBLE 0x0384 | ||
308 | +#define GLUT_VIDEO_RESIZE_IN_USE 0x0385 | ||
309 | +#define GLUT_VIDEO_RESIZE_X_DELTA 0x0386 | ||
310 | +#define GLUT_VIDEO_RESIZE_Y_DELTA 0x0387 | ||
311 | +#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 0x0388 | ||
312 | +#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 0x0389 | ||
313 | +#define GLUT_VIDEO_RESIZE_X 0x038A | ||
314 | +#define GLUT_VIDEO_RESIZE_Y 0x038B | ||
315 | +#define GLUT_VIDEO_RESIZE_WIDTH 0x038C | ||
316 | +#define GLUT_VIDEO_RESIZE_HEIGHT 0x038D | ||
317 | + | ||
318 | +/* | ||
319 | + * GLUT API macro definitions -- the glutUseLayer parameters | ||
320 | + */ | ||
321 | +#define GLUT_NORMAL 0x0000 | ||
322 | +#define GLUT_OVERLAY 0x0001 | ||
323 | + | ||
324 | +/* | ||
325 | + * GLUT API macro definitions -- the glutGetModifiers parameters | ||
326 | + */ | ||
327 | +#define GLUT_ACTIVE_SHIFT 0x0001 | ||
328 | +#define GLUT_ACTIVE_CTRL 0x0002 | ||
329 | +#define GLUT_ACTIVE_ALT 0x0004 | ||
330 | + | ||
331 | +/* | ||
332 | + * GLUT API macro definitions -- the glutSetCursor parameters | ||
333 | + */ | ||
334 | +#define GLUT_CURSOR_RIGHT_ARROW 0x0000 | ||
335 | +#define GLUT_CURSOR_LEFT_ARROW 0x0001 | ||
336 | +#define GLUT_CURSOR_INFO 0x0002 | ||
337 | +#define GLUT_CURSOR_DESTROY 0x0003 | ||
338 | +#define GLUT_CURSOR_HELP 0x0004 | ||
339 | +#define GLUT_CURSOR_CYCLE 0x0005 | ||
340 | +#define GLUT_CURSOR_SPRAY 0x0006 | ||
341 | +#define GLUT_CURSOR_WAIT 0x0007 | ||
342 | +#define GLUT_CURSOR_TEXT 0x0008 | ||
343 | +#define GLUT_CURSOR_CROSSHAIR 0x0009 | ||
344 | +#define GLUT_CURSOR_UP_DOWN 0x000A | ||
345 | +#define GLUT_CURSOR_LEFT_RIGHT 0x000B | ||
346 | +#define GLUT_CURSOR_TOP_SIDE 0x000C | ||
347 | +#define GLUT_CURSOR_BOTTOM_SIDE 0x000D | ||
348 | +#define GLUT_CURSOR_LEFT_SIDE 0x000E | ||
349 | +#define GLUT_CURSOR_RIGHT_SIDE 0x000F | ||
350 | +#define GLUT_CURSOR_TOP_LEFT_CORNER 0x0010 | ||
351 | +#define GLUT_CURSOR_TOP_RIGHT_CORNER 0x0011 | ||
352 | +#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 0x0012 | ||
353 | +#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 0x0013 | ||
354 | +#define GLUT_CURSOR_INHERIT 0x0064 | ||
355 | +#define GLUT_CURSOR_NONE 0x0065 | ||
356 | +#define GLUT_CURSOR_FULL_CROSSHAIR 0x0066 | ||
357 | + | ||
358 | +/* | ||
359 | + * GLUT API macro definitions -- RGB color component specification definitions | ||
360 | + */ | ||
361 | +#define GLUT_RED 0x0000 | ||
362 | +#define GLUT_GREEN 0x0001 | ||
363 | +#define GLUT_BLUE 0x0002 | ||
364 | + | ||
365 | +/* | ||
366 | + * GLUT API macro definitions -- additional keyboard and joystick definitions | ||
367 | + */ | ||
368 | +#define GLUT_KEY_REPEAT_OFF 0x0000 | ||
369 | +#define GLUT_KEY_REPEAT_ON 0x0001 | ||
370 | +#define GLUT_KEY_REPEAT_DEFAULT 0x0002 | ||
371 | + | ||
372 | +#define GLUT_JOYSTICK_BUTTON_A 0x0001 | ||
373 | +#define GLUT_JOYSTICK_BUTTON_B 0x0002 | ||
374 | +#define GLUT_JOYSTICK_BUTTON_C 0x0004 | ||
375 | +#define GLUT_JOYSTICK_BUTTON_D 0x0008 | ||
376 | + | ||
377 | +/* | ||
378 | + * GLUT API macro definitions -- game mode definitions | ||
379 | + */ | ||
380 | +#define GLUT_GAME_MODE_ACTIVE 0x0000 | ||
381 | +#define GLUT_GAME_MODE_POSSIBLE 0x0001 | ||
382 | +#define GLUT_GAME_MODE_WIDTH 0x0002 | ||
383 | +#define GLUT_GAME_MODE_HEIGHT 0x0003 | ||
384 | +#define GLUT_GAME_MODE_PIXEL_DEPTH 0x0004 | ||
385 | +#define GLUT_GAME_MODE_REFRESH_RATE 0x0005 | ||
386 | +#define GLUT_GAME_MODE_DISPLAY_CHANGED 0x0006 | ||
387 | + | ||
388 | +/* | ||
389 | + * Initialization functions, see fglut_init.c | ||
390 | + */ | ||
391 | +FGAPI void FGAPIENTRY glutInit( int* pargc, char** argv ); | ||
392 | +FGAPI void FGAPIENTRY glutInitWindowPosition( int x, int y ); | ||
393 | +FGAPI void FGAPIENTRY glutInitWindowSize( int width, int height ); | ||
394 | +FGAPI void FGAPIENTRY glutInitDisplayMode( unsigned int displayMode ); | ||
395 | +FGAPI void FGAPIENTRY glutInitDisplayString( const char* displayMode ); | ||
396 | + | ||
397 | +/* | ||
398 | + * Process loop function, see freeglut_main.c | ||
399 | + */ | ||
400 | +FGAPI void FGAPIENTRY glutMainLoop( void ); | ||
401 | + | ||
402 | +/* | ||
403 | + * Window management functions, see freeglut_window.c | ||
404 | + */ | ||
405 | +FGAPI int FGAPIENTRY glutCreateWindow( const char* title ); | ||
406 | +FGAPI int FGAPIENTRY glutCreateSubWindow( int window, int x, int y, int width, int height ); | ||
407 | +FGAPI void FGAPIENTRY glutDestroyWindow( int window ); | ||
408 | +FGAPI void FGAPIENTRY glutSetWindow( int window ); | ||
409 | +FGAPI int FGAPIENTRY glutGetWindow( void ); | ||
410 | +FGAPI void FGAPIENTRY glutSetWindowTitle( const char* title ); | ||
411 | +FGAPI void FGAPIENTRY glutSetIconTitle( const char* title ); | ||
412 | +FGAPI void FGAPIENTRY glutReshapeWindow( int width, int height ); | ||
413 | +FGAPI void FGAPIENTRY glutPositionWindow( int x, int y ); | ||
414 | +FGAPI void FGAPIENTRY glutShowWindow( void ); | ||
415 | +FGAPI void FGAPIENTRY glutHideWindow( void ); | ||
416 | +FGAPI void FGAPIENTRY glutIconifyWindow( void ); | ||
417 | +FGAPI void FGAPIENTRY glutPushWindow( void ); | ||
418 | +FGAPI void FGAPIENTRY glutPopWindow( void ); | ||
419 | +FGAPI void FGAPIENTRY glutFullScreen( void ); | ||
420 | + | ||
421 | +/* | ||
422 | + * Display-connected functions, see freeglut_display.c | ||
423 | + */ | ||
424 | +FGAPI void FGAPIENTRY glutPostWindowRedisplay( int window ); | ||
425 | +FGAPI void FGAPIENTRY glutPostRedisplay( void ); | ||
426 | +FGAPI void FGAPIENTRY glutSwapBuffers( void ); | ||
427 | + | ||
428 | +/* | ||
429 | + * Mouse cursor functions, see freeglut_cursor.c | ||
430 | + */ | ||
431 | +FGAPI void FGAPIENTRY glutWarpPointer( int x, int y ); | ||
432 | +FGAPI void FGAPIENTRY glutSetCursor( int cursor ); | ||
433 | + | ||
434 | +/* | ||
435 | + * Overlay stuff, see freeglut_overlay.c | ||
436 | + */ | ||
437 | +FGAPI void FGAPIENTRY glutEstablishOverlay( void ); | ||
438 | +FGAPI void FGAPIENTRY glutRemoveOverlay( void ); | ||
439 | +FGAPI void FGAPIENTRY glutUseLayer( GLenum layer ); | ||
440 | +FGAPI void FGAPIENTRY glutPostOverlayRedisplay( void ); | ||
441 | +FGAPI void FGAPIENTRY glutPostWindowOverlayRedisplay( int window ); | ||
442 | +FGAPI void FGAPIENTRY glutShowOverlay( void ); | ||
443 | +FGAPI void FGAPIENTRY glutHideOverlay( void ); | ||
444 | + | ||
445 | +/* | ||
446 | + * Menu stuff, see freeglut_menu.c | ||
447 | + */ | ||
448 | +FGAPI int FGAPIENTRY glutCreateMenu( void (* callback)( int menu ) ); | ||
449 | +FGAPI void FGAPIENTRY glutDestroyMenu( int menu ); | ||
450 | +FGAPI int FGAPIENTRY glutGetMenu( void ); | ||
451 | +FGAPI void FGAPIENTRY glutSetMenu( int menu ); | ||
452 | +FGAPI void FGAPIENTRY glutAddMenuEntry( const char* label, int value ); | ||
453 | +FGAPI void FGAPIENTRY glutAddSubMenu( const char* label, int subMenu ); | ||
454 | +FGAPI void FGAPIENTRY glutChangeToMenuEntry( int item, const char* label, int value ); | ||
455 | +FGAPI void FGAPIENTRY glutChangeToSubMenu( int item, const char* label, int value ); | ||
456 | +FGAPI void FGAPIENTRY glutRemoveMenuItem( int item ); | ||
457 | +FGAPI void FGAPIENTRY glutAttachMenu( int button ); | ||
458 | +FGAPI void FGAPIENTRY glutDetachMenu( int button ); | ||
459 | + | ||
460 | +/* | ||
461 | + * Global callback functions, see freeglut_callbacks.c | ||
462 | + */ | ||
463 | +FGAPI void FGAPIENTRY glutTimerFunc( unsigned int time, void (* callback)( int ), int value ); | ||
464 | +FGAPI void FGAPIENTRY glutIdleFunc( void (* callback)( void ) ); | ||
465 | + | ||
466 | +/* | ||
467 | + * Window-specific callback functions, see freeglut_callbacks.c | ||
468 | + */ | ||
469 | +FGAPI void FGAPIENTRY glutKeyboardFunc( void (* callback)( unsigned char, int, int ) ); | ||
470 | +FGAPI void FGAPIENTRY glutSpecialFunc( void (* callback)( int, int, int ) ); | ||
471 | +FGAPI void FGAPIENTRY glutReshapeFunc( void (* callback)( int, int ) ); | ||
472 | +FGAPI void FGAPIENTRY glutVisibilityFunc( void (* callback)( int ) ); | ||
473 | +FGAPI void FGAPIENTRY glutDisplayFunc( void (* callback)( void ) ); | ||
474 | +FGAPI void FGAPIENTRY glutMouseFunc( void (* callback)( int, int, int, int ) ); | ||
475 | +FGAPI void FGAPIENTRY glutMotionFunc( void (* callback)( int, int ) ); | ||
476 | +FGAPI void FGAPIENTRY glutPassiveMotionFunc( void (* callback)( int, int ) ); | ||
477 | +FGAPI void FGAPIENTRY glutEntryFunc( void (* callback)( int ) ); | ||
478 | + | ||
479 | +FGAPI void FGAPIENTRY glutKeyboardUpFunc( void (* callback)( unsigned char, int, int ) ); | ||
480 | +FGAPI void FGAPIENTRY glutSpecialUpFunc( void (* callback)( int, int, int ) ); | ||
481 | +FGAPI void FGAPIENTRY glutJoystickFunc( void (* callback)( unsigned int, int, int, int ), int pollInterval ); | ||
482 | +FGAPI void FGAPIENTRY glutMenuStateFunc( void (* callback)( int ) ); | ||
483 | +FGAPI void FGAPIENTRY glutMenuStatusFunc( void (* callback)( int, int, int ) ); | ||
484 | +FGAPI void FGAPIENTRY glutOverlayDisplayFunc( void (* callback)( void ) ); | ||
485 | +FGAPI void FGAPIENTRY glutWindowStatusFunc( void (* callback)( int ) ); | ||
486 | + | ||
487 | +FGAPI void FGAPIENTRY glutSpaceballMotionFunc( void (* callback)( int, int, int ) ); | ||
488 | +FGAPI void FGAPIENTRY glutSpaceballRotateFunc( void (* callback)( int, int, int ) ); | ||
489 | +FGAPI void FGAPIENTRY glutSpaceballButtonFunc( void (* callback)( int, int ) ); | ||
490 | +FGAPI void FGAPIENTRY glutButtonBoxFunc( void (* callback)( int, int ) ); | ||
491 | +FGAPI void FGAPIENTRY glutDialsFunc( void (* callback)( int, int ) ); | ||
492 | +FGAPI void FGAPIENTRY glutTabletMotionFunc( void (* callback)( int, int ) ); | ||
493 | +FGAPI void FGAPIENTRY glutTabletButtonFunc( void (* callback)( int, int, int, int ) ); | ||
494 | + | ||
495 | +/* | ||
496 | + * State setting and retrieval functions, see freeglut_state.c | ||
497 | + */ | ||
498 | +FGAPI int FGAPIENTRY glutGet( GLenum query ); | ||
499 | +FGAPI int FGAPIENTRY glutDeviceGet( GLenum query ); | ||
500 | +FGAPI int FGAPIENTRY glutGetModifiers( void ); | ||
501 | +FGAPI int FGAPIENTRY glutLayerGet( GLenum query ); | ||
502 | + | ||
503 | +/* | ||
504 | + * Font stuff, see freeglut_font.c | ||
505 | + */ | ||
506 | +FGAPI void FGAPIENTRY glutBitmapCharacter( void* font, int character ); | ||
507 | +FGAPI int FGAPIENTRY glutBitmapWidth( void* font, int character ); | ||
508 | +FGAPI void FGAPIENTRY glutStrokeCharacter( void* font, int character ); | ||
509 | +FGAPI int FGAPIENTRY glutStrokeWidth( void* font, int character ); | ||
510 | +FGAPI int FGAPIENTRY glutBitmapLength( void* font, const unsigned char* string ); | ||
511 | +FGAPI int FGAPIENTRY glutStrokeLength( void* font, const unsigned char* string ); | ||
512 | + | ||
513 | +/* | ||
514 | + * Geometry functions, see freeglut_geometry.c | ||
515 | + */ | ||
516 | +FGAPI void FGAPIENTRY glutWireCube( GLdouble size ); | ||
517 | +FGAPI void FGAPIENTRY glutSolidCube( GLdouble size ); | ||
518 | +FGAPI void FGAPIENTRY glutWireSphere( GLdouble radius, GLint slices, GLint stacks ); | ||
519 | +FGAPI void FGAPIENTRY glutSolidSphere( GLdouble radius, GLint slices, GLint stacks ); | ||
520 | +FGAPI void FGAPIENTRY glutWireCone( GLdouble base, GLdouble height, GLint slices, GLint stacks ); | ||
521 | +FGAPI void FGAPIENTRY glutSolidCone( GLdouble base, GLdouble height, GLint slices, GLint stacks ); | ||
522 | + | ||
523 | +FGAPI void FGAPIENTRY glutWireTorus( GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings ); | ||
524 | +FGAPI void FGAPIENTRY glutSolidTorus( GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings ); | ||
525 | +FGAPI void FGAPIENTRY glutWireDodecahedron( void ); | ||
526 | +FGAPI void FGAPIENTRY glutSolidDodecahedron( void ); | ||
527 | +FGAPI void FGAPIENTRY glutWireOctahedron( void ); | ||
528 | +FGAPI void FGAPIENTRY glutSolidOctahedron( void ); | ||
529 | +FGAPI void FGAPIENTRY glutWireTetrahedron( void ); | ||
530 | +FGAPI void FGAPIENTRY glutSolidTetrahedron( void ); | ||
531 | +FGAPI void FGAPIENTRY glutWireIcosahedron( void ); | ||
532 | +FGAPI void FGAPIENTRY glutSolidIcosahedron( void ); | ||
533 | + | ||
534 | +/* | ||
535 | + * Teapot rendering functions, found in freeglut_teapot.c | ||
536 | + */ | ||
537 | +FGAPI void FGAPIENTRY glutWireTeapot( GLdouble size ); | ||
538 | +FGAPI void FGAPIENTRY glutSolidTeapot( GLdouble size ); | ||
539 | + | ||
540 | +/* | ||
541 | + * Game mode functions, see freeglut_gamemode.c | ||
542 | + */ | ||
543 | +FGAPI void FGAPIENTRY glutGameModeString( const char* string ); | ||
544 | +FGAPI int FGAPIENTRY glutEnterGameMode( void ); | ||
545 | +FGAPI void FGAPIENTRY glutLeaveGameMode( void ); | ||
546 | +FGAPI int FGAPIENTRY glutGameModeGet( GLenum query ); | ||
547 | + | ||
548 | +/* | ||
549 | + * Video resize functions, see freeglut_videoresize.c | ||
550 | + */ | ||
551 | +FGAPI int FGAPIENTRY glutVideoResizeGet( GLenum query ); | ||
552 | +FGAPI void FGAPIENTRY glutSetupVideoResizing( void ); | ||
553 | +FGAPI void FGAPIENTRY glutStopVideoResizing( void ); | ||
554 | +FGAPI void FGAPIENTRY glutVideoResize( int x, int y, int width, int height ); | ||
555 | +FGAPI void FGAPIENTRY glutVideoPan( int x, int y, int width, int height ); | ||
556 | + | ||
557 | +/* | ||
558 | + * Colormap functions, see freeglut_misc.c | ||
559 | + */ | ||
560 | +FGAPI void FGAPIENTRY glutSetColor( int color, GLfloat red, GLfloat green, GLfloat blue ); | ||
561 | +FGAPI GLfloat FGAPIENTRY glutGetColor( int color, int component ); | ||
562 | +FGAPI void FGAPIENTRY glutCopyColormap( int window ); | ||
563 | + | ||
564 | +/* | ||
565 | + * Misc keyboard and joystick functions, see freeglut_misc.c | ||
566 | + */ | ||
567 | +FGAPI void FGAPIENTRY glutIgnoreKeyRepeat( int ignore ); | ||
568 | +FGAPI void FGAPIENTRY glutSetKeyRepeat( int repeatMode ); | ||
569 | +FGAPI void FGAPIENTRY glutForceJoystickFunc( void ); | ||
570 | + | ||
571 | +/* | ||
572 | + * Misc functions, see freeglut_misc.c | ||
573 | + */ | ||
574 | +FGAPI int FGAPIENTRY glutExtensionSupported( const char* extension ); | ||
575 | +FGAPI void FGAPIENTRY glutReportErrors( void ); | ||
576 | + | ||
577 | +/* Comment from glut.h of classic GLUT: | ||
578 | + | ||
579 | + Win32 has an annoying issue where there are multiple C run-time | ||
580 | + libraries (CRTs). If the executable is linked with a different CRT | ||
581 | + from the GLUT DLL, the GLUT DLL will not share the same CRT static | ||
582 | + data seen by the executable. In particular, atexit callbacks registered | ||
583 | + in the executable will not be called if GLUT calls its (different) | ||
584 | + exit routine). GLUT is typically built with the | ||
585 | + "/MD" option (the CRT with multithreading DLL support), but the Visual | ||
586 | + C++ linker default is "/ML" (the single threaded CRT). | ||
587 | + | ||
588 | + One workaround to this issue is requiring users to always link with | ||
589 | + the same CRT as GLUT is compiled with. That requires users supply a | ||
590 | + non-standard option. GLUT 3.7 has its own built-in workaround where | ||
591 | + the executable's "exit" function pointer is covertly passed to GLUT. | ||
592 | + GLUT then calls the executable's exit function pointer to ensure that | ||
593 | + any "atexit" calls registered by the application are called if GLUT | ||
594 | + needs to exit. | ||
595 | + | ||
596 | + Note that the __glut*WithExit routines should NEVER be called directly. | ||
597 | + To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */ | ||
598 | + | ||
599 | +/* to get the prototype for exit() */ | ||
600 | +#include <stdlib.h> | ||
601 | + | ||
602 | +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) && !defined(__WATCOMC__) | ||
603 | +FGAPI void FGAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int)); | ||
604 | +FGAPI int FGAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int)); | ||
605 | +FGAPI int FGAPIENTRY __glutCreateMenuWithExit(void (* func)(int), void (__cdecl *exitfunc)(int)); | ||
606 | +#ifndef FREEGLUT_BUILDING_LIB | ||
607 | +#if defined(__GNUC__) | ||
608 | +#define FGUNUSED __attribute__((unused)) | ||
609 | +#else | ||
610 | +#define FGUNUSED | ||
611 | +#endif | ||
612 | +static void FGAPIENTRY FGUNUSED glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); } | ||
613 | +#define glutInit glutInit_ATEXIT_HACK | ||
614 | +static int FGAPIENTRY FGUNUSED glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); } | ||
615 | +#define glutCreateWindow glutCreateWindow_ATEXIT_HACK | ||
616 | +static int FGAPIENTRY FGUNUSED glutCreateMenu_ATEXIT_HACK(void (* func)(int)) { return __glutCreateMenuWithExit(func, exit); } | ||
617 | +#define glutCreateMenu glutCreateMenu_ATEXIT_HACK | ||
618 | +#endif | ||
619 | +#endif | ||
620 | + | ||
621 | +#ifdef __cplusplus | ||
622 | + } | ||
623 | +#endif | ||
624 | + | ||
625 | +/*** END OF FILE ***/ | ||
626 | + | ||
627 | +#endif /* __FREEGLUT_STD_H__ */ | ||
628 | + |
gl/gl.h
0 → 100644
1 | +#ifndef __gl_h_ | ||
2 | +#define __gl_h_ | ||
3 | + | ||
4 | +#ifdef __cplusplus | ||
5 | +extern "C" { | ||
6 | +#endif | ||
7 | + | ||
8 | +/* | ||
9 | +** Copyright 1998-2002, NVIDIA Corporation. | ||
10 | +** All Rights Reserved. | ||
11 | +** | ||
12 | +** THE INFORMATION CONTAINED HEREIN IS PROPRIETARY AND CONFIDENTIAL TO | ||
13 | +** NVIDIA, CORPORATION. USE, REPRODUCTION OR DISCLOSURE TO ANY THIRD PARTY | ||
14 | +** IS SUBJECT TO WRITTEN PRE-APPROVAL BY NVIDIA, CORPORATION. | ||
15 | +** | ||
16 | +** | ||
17 | +** Copyright 1992-1999, Silicon Graphics, Inc. | ||
18 | +** All Rights Reserved. | ||
19 | +** | ||
20 | +** Portions of this file are UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon | ||
21 | +** Graphics, Inc.; the contents of this file may not be disclosed to third | ||
22 | +** parties, copied or duplicated in any form, in whole or in part, without | ||
23 | +** the prior written permission of Silicon Graphics, Inc. | ||
24 | +** | ||
25 | +** RESTRICTED RIGHTS LEGEND: | ||
26 | +** Use, duplication or disclosure by the Government is subject to | ||
27 | +** restrictions as set forth in subdivision (c)(1)(ii) of the Rights in | ||
28 | +** Technical Data and Computer Software clause at DFARS 252.227-7013, | ||
29 | +** and/or in similar or successor clauses in the FAR, DOD or NASA FAR | ||
30 | +** Supplement. Unpublished - rights reserved under the Copyright Laws of | ||
31 | +** the United States. | ||
32 | +*/ | ||
33 | + | ||
34 | +#ifndef APIENTRY | ||
35 | +#define APIENTRY | ||
36 | +#endif | ||
37 | + | ||
38 | +#ifndef WIN32 | ||
39 | +#define WINGDIAPI | ||
40 | +#endif | ||
41 | + | ||
42 | +#ifndef GLAPI | ||
43 | +# ifdef _WIN32 | ||
44 | +# define GLAPI __stdcall | ||
45 | +# else | ||
46 | +# define GLAPI | ||
47 | +# endif | ||
48 | +# define __DEFINED_GLAPI | ||
49 | +#endif | ||
50 | + | ||
51 | +/*************************************************************/ | ||
52 | + | ||
53 | +typedef unsigned int GLenum; | ||
54 | +typedef unsigned char GLboolean; | ||
55 | +typedef unsigned int GLbitfield; | ||
56 | +typedef signed char GLbyte; | ||
57 | +typedef short GLshort; | ||
58 | +typedef int GLint; | ||
59 | +typedef int GLsizei; | ||
60 | +typedef unsigned char GLubyte; | ||
61 | +typedef unsigned short GLushort; | ||
62 | +typedef unsigned int GLuint; | ||
63 | +typedef float GLfloat; | ||
64 | +typedef float GLclampf; | ||
65 | +typedef double GLdouble; | ||
66 | +typedef double GLclampd; | ||
67 | +typedef void GLvoid; | ||
68 | + | ||
69 | + | ||
70 | +/*************************************************************/ | ||
71 | + | ||
72 | +/* Version */ | ||
73 | +#define GL_VERSION_1_1 1 | ||
74 | + | ||
75 | +/* AttribMask */ | ||
76 | +#define GL_CURRENT_BIT 0x00000001 | ||
77 | +#define GL_POINT_BIT 0x00000002 | ||
78 | +#define GL_LINE_BIT 0x00000004 | ||
79 | +#define GL_POLYGON_BIT 0x00000008 | ||
80 | +#define GL_POLYGON_STIPPLE_BIT 0x00000010 | ||
81 | +#define GL_PIXEL_MODE_BIT 0x00000020 | ||
82 | +#define GL_LIGHTING_BIT 0x00000040 | ||
83 | +#define GL_FOG_BIT 0x00000080 | ||
84 | +#define GL_DEPTH_BUFFER_BIT 0x00000100 | ||
85 | +#define GL_ACCUM_BUFFER_BIT 0x00000200 | ||
86 | +#define GL_STENCIL_BUFFER_BIT 0x00000400 | ||
87 | +#define GL_VIEWPORT_BIT 0x00000800 | ||
88 | +#define GL_TRANSFORM_BIT 0x00001000 | ||
89 | +#define GL_ENABLE_BIT 0x00002000 | ||
90 | +#define GL_COLOR_BUFFER_BIT 0x00004000 | ||
91 | +#define GL_HINT_BIT 0x00008000 | ||
92 | +#define GL_EVAL_BIT 0x00010000 | ||
93 | +#define GL_LIST_BIT 0x00020000 | ||
94 | +#define GL_TEXTURE_BIT 0x00040000 | ||
95 | +#define GL_SCISSOR_BIT 0x00080000 | ||
96 | +#define GL_ALL_ATTRIB_BITS 0xFFFFFFFF | ||
97 | + | ||
98 | +/* ClearBufferMask */ | ||
99 | +/* GL_COLOR_BUFFER_BIT */ | ||
100 | +/* GL_ACCUM_BUFFER_BIT */ | ||
101 | +/* GL_STENCIL_BUFFER_BIT */ | ||
102 | +/* GL_DEPTH_BUFFER_BIT */ | ||
103 | + | ||
104 | +/* ClientAttribMask */ | ||
105 | +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 | ||
106 | +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 | ||
107 | +#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF | ||
108 | + | ||
109 | +/* Boolean */ | ||
110 | +#define GL_FALSE 0 | ||
111 | +#define GL_TRUE 1 | ||
112 | + | ||
113 | +/* BeginMode */ | ||
114 | +#define GL_POINTS 0x0000 | ||
115 | +#define GL_LINES 0x0001 | ||
116 | +#define GL_LINE_LOOP 0x0002 | ||
117 | +#define GL_LINE_STRIP 0x0003 | ||
118 | +#define GL_TRIANGLES 0x0004 | ||
119 | +#define GL_TRIANGLE_STRIP 0x0005 | ||
120 | +#define GL_TRIANGLE_FAN 0x0006 | ||
121 | +#define GL_QUADS 0x0007 | ||
122 | +#define GL_QUAD_STRIP 0x0008 | ||
123 | +#define GL_POLYGON 0x0009 | ||
124 | + | ||
125 | +/* AccumOp */ | ||
126 | +#define GL_ACCUM 0x0100 | ||
127 | +#define GL_LOAD 0x0101 | ||
128 | +#define GL_RETURN 0x0102 | ||
129 | +#define GL_MULT 0x0103 | ||
130 | +#define GL_ADD 0x0104 | ||
131 | + | ||
132 | +/* AlphaFunction */ | ||
133 | +#define GL_NEVER 0x0200 | ||
134 | +#define GL_LESS 0x0201 | ||
135 | +#define GL_EQUAL 0x0202 | ||
136 | +#define GL_LEQUAL 0x0203 | ||
137 | +#define GL_GREATER 0x0204 | ||
138 | +#define GL_NOTEQUAL 0x0205 | ||
139 | +#define GL_GEQUAL 0x0206 | ||
140 | +#define GL_ALWAYS 0x0207 | ||
141 | + | ||
142 | +/* BlendingFactorDest */ | ||
143 | +#define GL_ZERO 0 | ||
144 | +#define GL_ONE 1 | ||
145 | +#define GL_SRC_COLOR 0x0300 | ||
146 | +#define GL_ONE_MINUS_SRC_COLOR 0x0301 | ||
147 | +#define GL_SRC_ALPHA 0x0302 | ||
148 | +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 | ||
149 | +#define GL_DST_ALPHA 0x0304 | ||
150 | +#define GL_ONE_MINUS_DST_ALPHA 0x0305 | ||
151 | + | ||
152 | +/* BlendingFactorSrc */ | ||
153 | +/* GL_ZERO */ | ||
154 | +/* GL_ONE */ | ||
155 | +#define GL_DST_COLOR 0x0306 | ||
156 | +#define GL_ONE_MINUS_DST_COLOR 0x0307 | ||
157 | +#define GL_SRC_ALPHA_SATURATE 0x0308 | ||
158 | +/* GL_SRC_ALPHA */ | ||
159 | +/* GL_ONE_MINUS_SRC_ALPHA */ | ||
160 | +/* GL_DST_ALPHA */ | ||
161 | +/* GL_ONE_MINUS_DST_ALPHA */ | ||
162 | + | ||
163 | +/* ColorMaterialFace */ | ||
164 | +/* GL_FRONT */ | ||
165 | +/* GL_BACK */ | ||
166 | +/* GL_FRONT_AND_BACK */ | ||
167 | + | ||
168 | +/* ColorMaterialParameter */ | ||
169 | +/* GL_AMBIENT */ | ||
170 | +/* GL_DIFFUSE */ | ||
171 | +/* GL_SPECULAR */ | ||
172 | +/* GL_EMISSION */ | ||
173 | +/* GL_AMBIENT_AND_DIFFUSE */ | ||
174 | + | ||
175 | +/* ColorPointerType */ | ||
176 | +/* GL_BYTE */ | ||
177 | +/* GL_UNSIGNED_BYTE */ | ||
178 | +/* GL_SHORT */ | ||
179 | +/* GL_UNSIGNED_SHORT */ | ||
180 | +/* GL_INT */ | ||
181 | +/* GL_UNSIGNED_INT */ | ||
182 | +/* GL_FLOAT */ | ||
183 | +/* GL_DOUBLE */ | ||
184 | + | ||
185 | +/* CullFaceMode */ | ||
186 | +/* GL_FRONT */ | ||
187 | +/* GL_BACK */ | ||
188 | +/* GL_FRONT_AND_BACK */ | ||
189 | + | ||
190 | +/* DepthFunction */ | ||
191 | +/* GL_NEVER */ | ||
192 | +/* GL_LESS */ | ||
193 | +/* GL_EQUAL */ | ||
194 | +/* GL_LEQUAL */ | ||
195 | +/* GL_GREATER */ | ||
196 | +/* GL_NOTEQUAL */ | ||
197 | +/* GL_GEQUAL */ | ||
198 | +/* GL_ALWAYS */ | ||
199 | + | ||
200 | +/* DrawBufferMode */ | ||
201 | +#define GL_NONE 0 | ||
202 | +#define GL_FRONT_LEFT 0x0400 | ||
203 | +#define GL_FRONT_RIGHT 0x0401 | ||
204 | +#define GL_BACK_LEFT 0x0402 | ||
205 | +#define GL_BACK_RIGHT 0x0403 | ||
206 | +#define GL_FRONT 0x0404 | ||
207 | +#define GL_BACK 0x0405 | ||
208 | +#define GL_LEFT 0x0406 | ||
209 | +#define GL_RIGHT 0x0407 | ||
210 | +#define GL_FRONT_AND_BACK 0x0408 | ||
211 | +#define GL_AUX0 0x0409 | ||
212 | +#define GL_AUX1 0x040A | ||
213 | +#define GL_AUX2 0x040B | ||
214 | +#define GL_AUX3 0x040C | ||
215 | + | ||
216 | +/* EnableCap */ | ||
217 | +/* GL_FOG */ | ||
218 | +/* GL_LIGHTING */ | ||
219 | +/* GL_TEXTURE_1D */ | ||
220 | +/* GL_TEXTURE_2D */ | ||
221 | +/* GL_LINE_STIPPLE */ | ||
222 | +/* GL_POLYGON_STIPPLE */ | ||
223 | +/* GL_CULL_FACE */ | ||
224 | +/* GL_ALPHA_TEST */ | ||
225 | +/* GL_BLEND */ | ||
226 | +/* GL_INDEX_LOGIC_OP */ | ||
227 | +/* GL_COLOR_LOGIC_OP */ | ||
228 | +/* GL_DITHER */ | ||
229 | +/* GL_STENCIL_TEST */ | ||
230 | +/* GL_DEPTH_TEST */ | ||
231 | +/* GL_CLIP_PLANE0 */ | ||
232 | +/* GL_CLIP_PLANE1 */ | ||
233 | +/* GL_CLIP_PLANE2 */ | ||
234 | +/* GL_CLIP_PLANE3 */ | ||
235 | +/* GL_CLIP_PLANE4 */ | ||
236 | +/* GL_CLIP_PLANE5 */ | ||
237 | +/* GL_LIGHT0 */ | ||
238 | +/* GL_LIGHT1 */ | ||
239 | +/* GL_LIGHT2 */ | ||
240 | +/* GL_LIGHT3 */ | ||
241 | +/* GL_LIGHT4 */ | ||
242 | +/* GL_LIGHT5 */ | ||
243 | +/* GL_LIGHT6 */ | ||
244 | +/* GL_LIGHT7 */ | ||
245 | +/* GL_TEXTURE_GEN_S */ | ||
246 | +/* GL_TEXTURE_GEN_T */ | ||
247 | +/* GL_TEXTURE_GEN_R */ | ||
248 | +/* GL_TEXTURE_GEN_Q */ | ||
249 | +/* GL_MAP1_VERTEX_3 */ | ||
250 | +/* GL_MAP1_VERTEX_4 */ | ||
251 | +/* GL_MAP1_COLOR_4 */ | ||
252 | +/* GL_MAP1_INDEX */ | ||
253 | +/* GL_MAP1_NORMAL */ | ||
254 | +/* GL_MAP1_TEXTURE_COORD_1 */ | ||
255 | +/* GL_MAP1_TEXTURE_COORD_2 */ | ||
256 | +/* GL_MAP1_TEXTURE_COORD_3 */ | ||
257 | +/* GL_MAP1_TEXTURE_COORD_4 */ | ||
258 | +/* GL_MAP2_VERTEX_3 */ | ||
259 | +/* GL_MAP2_VERTEX_4 */ | ||
260 | +/* GL_MAP2_COLOR_4 */ | ||
261 | +/* GL_MAP2_INDEX */ | ||
262 | +/* GL_MAP2_NORMAL */ | ||
263 | +/* GL_MAP2_TEXTURE_COORD_1 */ | ||
264 | +/* GL_MAP2_TEXTURE_COORD_2 */ | ||
265 | +/* GL_MAP2_TEXTURE_COORD_3 */ | ||
266 | +/* GL_MAP2_TEXTURE_COORD_4 */ | ||
267 | +/* GL_POINT_SMOOTH */ | ||
268 | +/* GL_LINE_SMOOTH */ | ||
269 | +/* GL_POLYGON_SMOOTH */ | ||
270 | +/* GL_SCISSOR_TEST */ | ||
271 | +/* GL_COLOR_MATERIAL */ | ||
272 | +/* GL_NORMALIZE */ | ||
273 | +/* GL_AUTO_NORMAL */ | ||
274 | +/* GL_POLYGON_OFFSET_POINT */ | ||
275 | +/* GL_POLYGON_OFFSET_LINE */ | ||
276 | +/* GL_POLYGON_OFFSET_FILL */ | ||
277 | +/* GL_VERTEX_ARRAY */ | ||
278 | +/* GL_NORMAL_ARRAY */ | ||
279 | +/* GL_COLOR_ARRAY */ | ||
280 | +/* GL_INDEX_ARRAY */ | ||
281 | +/* GL_TEXTURE_COORD_ARRAY */ | ||
282 | +/* GL_EDGE_FLAG_ARRAY */ | ||
283 | + | ||
284 | +/* ErrorCode */ | ||
285 | +#define GL_NO_ERROR 0 | ||
286 | +#define GL_INVALID_ENUM 0x0500 | ||
287 | +#define GL_INVALID_VALUE 0x0501 | ||
288 | +#define GL_INVALID_OPERATION 0x0502 | ||
289 | +#define GL_STACK_OVERFLOW 0x0503 | ||
290 | +#define GL_STACK_UNDERFLOW 0x0504 | ||
291 | +#define GL_OUT_OF_MEMORY 0x0505 | ||
292 | +#define GL_TABLE_TOO_LARGE 0x8031 | ||
293 | + | ||
294 | +/* FeedbackType */ | ||
295 | +#define GL_2D 0x0600 | ||
296 | +#define GL_3D 0x0601 | ||
297 | +#define GL_3D_COLOR 0x0602 | ||
298 | +#define GL_3D_COLOR_TEXTURE 0x0603 | ||
299 | +#define GL_4D_COLOR_TEXTURE 0x0604 | ||
300 | + | ||
301 | +/* FeedBackToken */ | ||
302 | +#define GL_PASS_THROUGH_TOKEN 0x0700 | ||
303 | +#define GL_POINT_TOKEN 0x0701 | ||
304 | +#define GL_LINE_TOKEN 0x0702 | ||
305 | +#define GL_POLYGON_TOKEN 0x0703 | ||
306 | +#define GL_BITMAP_TOKEN 0x0704 | ||
307 | +#define GL_DRAW_PIXEL_TOKEN 0x0705 | ||
308 | +#define GL_COPY_PIXEL_TOKEN 0x0706 | ||
309 | +#define GL_LINE_RESET_TOKEN 0x0707 | ||
310 | + | ||
311 | +/* FogMode */ | ||
312 | +/* GL_LINEAR */ | ||
313 | +#define GL_EXP 0x0800 | ||
314 | +#define GL_EXP2 0x0801 | ||
315 | + | ||
316 | +/* FogParameter */ | ||
317 | +/* GL_FOG_COLOR */ | ||
318 | +/* GL_FOG_DENSITY */ | ||
319 | +/* GL_FOG_END */ | ||
320 | +/* GL_FOG_INDEX */ | ||
321 | +/* GL_FOG_MODE */ | ||
322 | +/* GL_FOG_START */ | ||
323 | + | ||
324 | +/* FrontFaceDirection */ | ||
325 | +#define GL_CW 0x0900 | ||
326 | +#define GL_CCW 0x0901 | ||
327 | + | ||
328 | +/* GetMapQuery */ | ||
329 | +#define GL_COEFF 0x0A00 | ||
330 | +#define GL_ORDER 0x0A01 | ||
331 | +#define GL_DOMAIN 0x0A02 | ||
332 | + | ||
333 | +/* GetPixelMap */ | ||
334 | +#define GL_PIXEL_MAP_I_TO_I 0x0C70 | ||
335 | +#define GL_PIXEL_MAP_S_TO_S 0x0C71 | ||
336 | +#define GL_PIXEL_MAP_I_TO_R 0x0C72 | ||
337 | +#define GL_PIXEL_MAP_I_TO_G 0x0C73 | ||
338 | +#define GL_PIXEL_MAP_I_TO_B 0x0C74 | ||
339 | +#define GL_PIXEL_MAP_I_TO_A 0x0C75 | ||
340 | +#define GL_PIXEL_MAP_R_TO_R 0x0C76 | ||
341 | +#define GL_PIXEL_MAP_G_TO_G 0x0C77 | ||
342 | +#define GL_PIXEL_MAP_B_TO_B 0x0C78 | ||
343 | +#define GL_PIXEL_MAP_A_TO_A 0x0C79 | ||
344 | + | ||
345 | +/* GetPointervPName */ | ||
346 | +#define GL_VERTEX_ARRAY_POINTER 0x808E | ||
347 | +#define GL_NORMAL_ARRAY_POINTER 0x808F | ||
348 | +#define GL_COLOR_ARRAY_POINTER 0x8090 | ||
349 | +#define GL_INDEX_ARRAY_POINTER 0x8091 | ||
350 | +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 | ||
351 | +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 | ||
352 | + | ||
353 | +/* GetPName */ | ||
354 | +#define GL_CURRENT_COLOR 0x0B00 | ||
355 | +#define GL_CURRENT_INDEX 0x0B01 | ||
356 | +#define GL_CURRENT_NORMAL 0x0B02 | ||
357 | +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 | ||
358 | +#define GL_CURRENT_RASTER_COLOR 0x0B04 | ||
359 | +#define GL_CURRENT_RASTER_INDEX 0x0B05 | ||
360 | +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 | ||
361 | +#define GL_CURRENT_RASTER_POSITION 0x0B07 | ||
362 | +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 | ||
363 | +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 | ||
364 | +#define GL_POINT_SMOOTH 0x0B10 | ||
365 | +#define GL_POINT_SIZE 0x0B11 | ||
366 | +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 | ||
367 | +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 | ||
368 | +#define GL_POINT_SIZE_RANGE GL_SMOOTH_POINT_SIZE_RANGE | ||
369 | +#define GL_POINT_SIZE_GRANULARITY GL_SMOOTH_POINT_SIZE_GRANULARITY | ||
370 | +#define GL_LINE_SMOOTH 0x0B20 | ||
371 | +#define GL_LINE_WIDTH 0x0B21 | ||
372 | +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 | ||
373 | +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 | ||
374 | +#define GL_LINE_WIDTH_RANGE GL_SMOOTH_LINE_WIDTH_RANGE | ||
375 | +#define GL_LINE_WIDTH_GRANULARITY GL_SMOOTH_LINE_WIDTH_GRANULARITY | ||
376 | +#define GL_LINE_STIPPLE 0x0B24 | ||
377 | +#define GL_LINE_STIPPLE_PATTERN 0x0B25 | ||
378 | +#define GL_LINE_STIPPLE_REPEAT 0x0B26 | ||
379 | +#define GL_LIST_MODE 0x0B30 | ||
380 | +#define GL_MAX_LIST_NESTING 0x0B31 | ||
381 | +#define GL_LIST_BASE 0x0B32 | ||
382 | +#define GL_LIST_INDEX 0x0B33 | ||
383 | +#define GL_POLYGON_MODE 0x0B40 | ||
384 | +#define GL_POLYGON_SMOOTH 0x0B41 | ||
385 | +#define GL_POLYGON_STIPPLE 0x0B42 | ||
386 | +#define GL_EDGE_FLAG 0x0B43 | ||
387 | +#define GL_CULL_FACE 0x0B44 | ||
388 | +#define GL_CULL_FACE_MODE 0x0B45 | ||
389 | +#define GL_FRONT_FACE 0x0B46 | ||
390 | +#define GL_LIGHTING 0x0B50 | ||
391 | +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 | ||
392 | +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 | ||
393 | +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 | ||
394 | +#define GL_SHADE_MODEL 0x0B54 | ||
395 | +#define GL_COLOR_MATERIAL_FACE 0x0B55 | ||
396 | +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 | ||
397 | +#define GL_COLOR_MATERIAL 0x0B57 | ||
398 | +#define GL_FOG 0x0B60 | ||
399 | +#define GL_FOG_INDEX 0x0B61 | ||
400 | +#define GL_FOG_DENSITY 0x0B62 | ||
401 | +#define GL_FOG_START 0x0B63 | ||
402 | +#define GL_FOG_END 0x0B64 | ||
403 | +#define GL_FOG_MODE 0x0B65 | ||
404 | +#define GL_FOG_COLOR 0x0B66 | ||
405 | +#define GL_DEPTH_RANGE 0x0B70 | ||
406 | +#define GL_DEPTH_TEST 0x0B71 | ||
407 | +#define GL_DEPTH_WRITEMASK 0x0B72 | ||
408 | +#define GL_DEPTH_CLEAR_VALUE 0x0B73 | ||
409 | +#define GL_DEPTH_FUNC 0x0B74 | ||
410 | +#define GL_ACCUM_CLEAR_VALUE 0x0B80 | ||
411 | +#define GL_STENCIL_TEST 0x0B90 | ||
412 | +#define GL_STENCIL_CLEAR_VALUE 0x0B91 | ||
413 | +#define GL_STENCIL_FUNC 0x0B92 | ||
414 | +#define GL_STENCIL_VALUE_MASK 0x0B93 | ||
415 | +#define GL_STENCIL_FAIL 0x0B94 | ||
416 | +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 | ||
417 | +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 | ||
418 | +#define GL_STENCIL_REF 0x0B97 | ||
419 | +#define GL_STENCIL_WRITEMASK 0x0B98 | ||
420 | +#define GL_MATRIX_MODE 0x0BA0 | ||
421 | +#define GL_NORMALIZE 0x0BA1 | ||
422 | +#define GL_VIEWPORT 0x0BA2 | ||
423 | +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 | ||
424 | +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 | ||
425 | +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 | ||
426 | +#define GL_MODELVIEW_MATRIX 0x0BA6 | ||
427 | +#define GL_PROJECTION_MATRIX 0x0BA7 | ||
428 | +#define GL_TEXTURE_MATRIX 0x0BA8 | ||
429 | +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 | ||
430 | +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 | ||
431 | +#define GL_ALPHA_TEST 0x0BC0 | ||
432 | +#define GL_ALPHA_TEST_FUNC 0x0BC1 | ||
433 | +#define GL_ALPHA_TEST_REF 0x0BC2 | ||
434 | +#define GL_DITHER 0x0BD0 | ||
435 | +#define GL_BLEND_DST 0x0BE0 | ||
436 | +#define GL_BLEND_SRC 0x0BE1 | ||
437 | +#define GL_BLEND 0x0BE2 | ||
438 | +#define GL_LOGIC_OP_MODE 0x0BF0 | ||
439 | +#define GL_INDEX_LOGIC_OP 0x0BF1 | ||
440 | +#define GL_LOGIC_OP GL_INDEX_LOGIC_OP | ||
441 | +#define GL_COLOR_LOGIC_OP 0x0BF2 | ||
442 | +#define GL_AUX_BUFFERS 0x0C00 | ||
443 | +#define GL_DRAW_BUFFER 0x0C01 | ||
444 | +#define GL_READ_BUFFER 0x0C02 | ||
445 | +#define GL_SCISSOR_BOX 0x0C10 | ||
446 | +#define GL_SCISSOR_TEST 0x0C11 | ||
447 | +#define GL_INDEX_CLEAR_VALUE 0x0C20 | ||
448 | +#define GL_INDEX_WRITEMASK 0x0C21 | ||
449 | +#define GL_COLOR_CLEAR_VALUE 0x0C22 | ||
450 | +#define GL_COLOR_WRITEMASK 0x0C23 | ||
451 | +#define GL_INDEX_MODE 0x0C30 | ||
452 | +#define GL_RGBA_MODE 0x0C31 | ||
453 | +#define GL_DOUBLEBUFFER 0x0C32 | ||
454 | +#define GL_STEREO 0x0C33 | ||
455 | +#define GL_RENDER_MODE 0x0C40 | ||
456 | +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 | ||
457 | +#define GL_POINT_SMOOTH_HINT 0x0C51 | ||
458 | +#define GL_LINE_SMOOTH_HINT 0x0C52 | ||
459 | +#define GL_POLYGON_SMOOTH_HINT 0x0C53 | ||
460 | +#define GL_FOG_HINT 0x0C54 | ||
461 | +#define GL_TEXTURE_GEN_S 0x0C60 | ||
462 | +#define GL_TEXTURE_GEN_T 0x0C61 | ||
463 | +#define GL_TEXTURE_GEN_R 0x0C62 | ||
464 | +#define GL_TEXTURE_GEN_Q 0x0C63 | ||
465 | +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 | ||
466 | +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 | ||
467 | +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 | ||
468 | +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 | ||
469 | +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 | ||
470 | +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 | ||
471 | +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 | ||
472 | +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 | ||
473 | +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 | ||
474 | +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 | ||
475 | +#define GL_UNPACK_SWAP_BYTES 0x0CF0 | ||
476 | +#define GL_UNPACK_LSB_FIRST 0x0CF1 | ||
477 | +#define GL_UNPACK_ROW_LENGTH 0x0CF2 | ||
478 | +#define GL_UNPACK_SKIP_ROWS 0x0CF3 | ||
479 | +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 | ||
480 | +#define GL_UNPACK_ALIGNMENT 0x0CF5 | ||
481 | +#define GL_PACK_SWAP_BYTES 0x0D00 | ||
482 | +#define GL_PACK_LSB_FIRST 0x0D01 | ||
483 | +#define GL_PACK_ROW_LENGTH 0x0D02 | ||
484 | +#define GL_PACK_SKIP_ROWS 0x0D03 | ||
485 | +#define GL_PACK_SKIP_PIXELS 0x0D04 | ||
486 | +#define GL_PACK_ALIGNMENT 0x0D05 | ||
487 | +#define GL_MAP_COLOR 0x0D10 | ||
488 | +#define GL_MAP_STENCIL 0x0D11 | ||
489 | +#define GL_INDEX_SHIFT 0x0D12 | ||
490 | +#define GL_INDEX_OFFSET 0x0D13 | ||
491 | +#define GL_RED_SCALE 0x0D14 | ||
492 | +#define GL_RED_BIAS 0x0D15 | ||
493 | +#define GL_ZOOM_X 0x0D16 | ||
494 | +#define GL_ZOOM_Y 0x0D17 | ||
495 | +#define GL_GREEN_SCALE 0x0D18 | ||
496 | +#define GL_GREEN_BIAS 0x0D19 | ||
497 | +#define GL_BLUE_SCALE 0x0D1A | ||
498 | +#define GL_BLUE_BIAS 0x0D1B | ||
499 | +#define GL_ALPHA_SCALE 0x0D1C | ||
500 | +#define GL_ALPHA_BIAS 0x0D1D | ||
501 | +#define GL_DEPTH_SCALE 0x0D1E | ||
502 | +#define GL_DEPTH_BIAS 0x0D1F | ||
503 | +#define GL_MAX_EVAL_ORDER 0x0D30 | ||
504 | +#define GL_MAX_LIGHTS 0x0D31 | ||
505 | +#define GL_MAX_CLIP_PLANES 0x0D32 | ||
506 | +#define GL_MAX_TEXTURE_SIZE 0x0D33 | ||
507 | +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 | ||
508 | +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 | ||
509 | +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 | ||
510 | +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 | ||
511 | +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 | ||
512 | +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 | ||
513 | +#define GL_MAX_VIEWPORT_DIMS 0x0D3A | ||
514 | +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B | ||
515 | +#define GL_SUBPIXEL_BITS 0x0D50 | ||
516 | +#define GL_INDEX_BITS 0x0D51 | ||
517 | +#define GL_RED_BITS 0x0D52 | ||
518 | +#define GL_GREEN_BITS 0x0D53 | ||
519 | +#define GL_BLUE_BITS 0x0D54 | ||
520 | +#define GL_ALPHA_BITS 0x0D55 | ||
521 | +#define GL_DEPTH_BITS 0x0D56 | ||
522 | +#define GL_STENCIL_BITS 0x0D57 | ||
523 | +#define GL_ACCUM_RED_BITS 0x0D58 | ||
524 | +#define GL_ACCUM_GREEN_BITS 0x0D59 | ||
525 | +#define GL_ACCUM_BLUE_BITS 0x0D5A | ||
526 | +#define GL_ACCUM_ALPHA_BITS 0x0D5B | ||
527 | +#define GL_NAME_STACK_DEPTH 0x0D70 | ||
528 | +#define GL_AUTO_NORMAL 0x0D80 | ||
529 | +#define GL_MAP1_COLOR_4 0x0D90 | ||
530 | +#define GL_MAP1_INDEX 0x0D91 | ||
531 | +#define GL_MAP1_NORMAL 0x0D92 | ||
532 | +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 | ||
533 | +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 | ||
534 | +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 | ||
535 | +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 | ||
536 | +#define GL_MAP1_VERTEX_3 0x0D97 | ||
537 | +#define GL_MAP1_VERTEX_4 0x0D98 | ||
538 | +#define GL_MAP2_COLOR_4 0x0DB0 | ||
539 | +#define GL_MAP2_INDEX 0x0DB1 | ||
540 | +#define GL_MAP2_NORMAL 0x0DB2 | ||
541 | +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 | ||
542 | +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 | ||
543 | +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 | ||
544 | +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 | ||
545 | +#define GL_MAP2_VERTEX_3 0x0DB7 | ||
546 | +#define GL_MAP2_VERTEX_4 0x0DB8 | ||
547 | +#define GL_MAP1_GRID_DOMAIN 0x0DD0 | ||
548 | +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 | ||
549 | +#define GL_MAP2_GRID_DOMAIN 0x0DD2 | ||
550 | +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 | ||
551 | +#define GL_TEXTURE_1D 0x0DE0 | ||
552 | +#define GL_TEXTURE_2D 0x0DE1 | ||
553 | +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 | ||
554 | +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 | ||
555 | +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 | ||
556 | +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 | ||
557 | +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 | ||
558 | +#define GL_POLYGON_OFFSET_UNITS 0x2A00 | ||
559 | +#define GL_POLYGON_OFFSET_POINT 0x2A01 | ||
560 | +#define GL_POLYGON_OFFSET_LINE 0x2A02 | ||
561 | +#define GL_POLYGON_OFFSET_FILL 0x8037 | ||
562 | +#define GL_POLYGON_OFFSET_FACTOR 0x8038 | ||
563 | +#define GL_TEXTURE_BINDING_1D 0x8068 | ||
564 | +#define GL_TEXTURE_BINDING_2D 0x8069 | ||
565 | +#define GL_TEXTURE_BINDING_3D 0x806A | ||
566 | +#define GL_VERTEX_ARRAY 0x8074 | ||
567 | +#define GL_NORMAL_ARRAY 0x8075 | ||
568 | +#define GL_COLOR_ARRAY 0x8076 | ||
569 | +#define GL_INDEX_ARRAY 0x8077 | ||
570 | +#define GL_TEXTURE_COORD_ARRAY 0x8078 | ||
571 | +#define GL_EDGE_FLAG_ARRAY 0x8079 | ||
572 | +#define GL_VERTEX_ARRAY_SIZE 0x807A | ||
573 | +#define GL_VERTEX_ARRAY_TYPE 0x807B | ||
574 | +#define GL_VERTEX_ARRAY_STRIDE 0x807C | ||
575 | +#define GL_NORMAL_ARRAY_TYPE 0x807E | ||
576 | +#define GL_NORMAL_ARRAY_STRIDE 0x807F | ||
577 | +#define GL_COLOR_ARRAY_SIZE 0x8081 | ||
578 | +#define GL_COLOR_ARRAY_TYPE 0x8082 | ||
579 | +#define GL_COLOR_ARRAY_STRIDE 0x8083 | ||
580 | +#define GL_INDEX_ARRAY_TYPE 0x8085 | ||
581 | +#define GL_INDEX_ARRAY_STRIDE 0x8086 | ||
582 | +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 | ||
583 | +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 | ||
584 | +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A | ||
585 | +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C | ||
586 | +/* GL_VERTEX_ARRAY_COUNT_EXT */ | ||
587 | +/* GL_NORMAL_ARRAY_COUNT_EXT */ | ||
588 | +/* GL_COLOR_ARRAY_COUNT_EXT */ | ||
589 | +/* GL_INDEX_ARRAY_COUNT_EXT */ | ||
590 | +/* GL_TEXTURE_COORD_ARRAY_COUNT_EXT */ | ||
591 | +/* GL_EDGE_FLAG_ARRAY_COUNT_EXT */ | ||
592 | + | ||
593 | +/* GetTextureParameter */ | ||
594 | +/* GL_TEXTURE_MAG_FILTER */ | ||
595 | +/* GL_TEXTURE_MIN_FILTER */ | ||
596 | +/* GL_TEXTURE_WRAP_S */ | ||
597 | +/* GL_TEXTURE_WRAP_T */ | ||
598 | +#define GL_TEXTURE_WIDTH 0x1000 | ||
599 | +#define GL_TEXTURE_HEIGHT 0x1001 | ||
600 | +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 | ||
601 | +#define GL_TEXTURE_COMPONENTS GL_TEXTURE_INTERNAL_FORMAT | ||
602 | +#define GL_TEXTURE_BORDER_COLOR 0x1004 | ||
603 | +#define GL_TEXTURE_BORDER 0x1005 | ||
604 | +#define GL_TEXTURE_RED_SIZE 0x805C | ||
605 | +#define GL_TEXTURE_GREEN_SIZE 0x805D | ||
606 | +#define GL_TEXTURE_BLUE_SIZE 0x805E | ||
607 | +#define GL_TEXTURE_ALPHA_SIZE 0x805F | ||
608 | +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 | ||
609 | +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 | ||
610 | +#define GL_TEXTURE_PRIORITY 0x8066 | ||
611 | +#define GL_TEXTURE_RESIDENT 0x8067 | ||
612 | + | ||
613 | +/* HintMode */ | ||
614 | +#define GL_DONT_CARE 0x1100 | ||
615 | +#define GL_FASTEST 0x1101 | ||
616 | +#define GL_NICEST 0x1102 | ||
617 | + | ||
618 | +/* HintTarget */ | ||
619 | +/* GL_PERSPECTIVE_CORRECTION_HINT */ | ||
620 | +/* GL_POINT_SMOOTH_HINT */ | ||
621 | +/* GL_LINE_SMOOTH_HINT */ | ||
622 | +/* GL_POLYGON_SMOOTH_HINT */ | ||
623 | +/* GL_FOG_HINT */ | ||
624 | + | ||
625 | +/* IndexMaterialParameterSGI */ | ||
626 | +/* GL_INDEX_OFFSET */ | ||
627 | + | ||
628 | +/* IndexPointerType */ | ||
629 | +/* GL_SHORT */ | ||
630 | +/* GL_INT */ | ||
631 | +/* GL_FLOAT */ | ||
632 | +/* GL_DOUBLE */ | ||
633 | + | ||
634 | +/* IndexFunctionSGI */ | ||
635 | +/* GL_NEVER */ | ||
636 | +/* GL_LESS */ | ||
637 | +/* GL_EQUAL */ | ||
638 | +/* GL_LEQUAL */ | ||
639 | +/* GL_GREATER */ | ||
640 | +/* GL_NOTEQUAL */ | ||
641 | +/* GL_GEQUAL */ | ||
642 | +/* GL_ALWAYS */ | ||
643 | + | ||
644 | +/* LightModelParameter */ | ||
645 | +/* GL_LIGHT_MODEL_AMBIENT */ | ||
646 | +/* GL_LIGHT_MODEL_LOCAL_VIEWER */ | ||
647 | +/* GL_LIGHT_MODEL_TWO_SIDE */ | ||
648 | + | ||
649 | +/* LightParameter */ | ||
650 | +#define GL_AMBIENT 0x1200 | ||
651 | +#define GL_DIFFUSE 0x1201 | ||
652 | +#define GL_SPECULAR 0x1202 | ||
653 | +#define GL_POSITION 0x1203 | ||
654 | +#define GL_SPOT_DIRECTION 0x1204 | ||
655 | +#define GL_SPOT_EXPONENT 0x1205 | ||
656 | +#define GL_SPOT_CUTOFF 0x1206 | ||
657 | +#define GL_CONSTANT_ATTENUATION 0x1207 | ||
658 | +#define GL_LINEAR_ATTENUATION 0x1208 | ||
659 | +#define GL_QUADRATIC_ATTENUATION 0x1209 | ||
660 | + | ||
661 | +/* ListMode */ | ||
662 | +#define GL_COMPILE 0x1300 | ||
663 | +#define GL_COMPILE_AND_EXECUTE 0x1301 | ||
664 | + | ||
665 | +/* DataType */ | ||
666 | +#define GL_BYTE 0x1400 | ||
667 | +#define GL_UNSIGNED_BYTE 0x1401 | ||
668 | +#define GL_SHORT 0x1402 | ||
669 | +#define GL_UNSIGNED_SHORT 0x1403 | ||
670 | +#define GL_INT 0x1404 | ||
671 | +#define GL_UNSIGNED_INT 0x1405 | ||
672 | +#define GL_FLOAT 0x1406 | ||
673 | +#define GL_2_BYTES 0x1407 | ||
674 | +#define GL_3_BYTES 0x1408 | ||
675 | +#define GL_4_BYTES 0x1409 | ||
676 | +#define GL_DOUBLE 0x140A | ||
677 | +#define GL_DOUBLE_EXT 0x140A | ||
678 | + | ||
679 | +/* ListNameType */ | ||
680 | +/* GL_BYTE */ | ||
681 | +/* GL_UNSIGNED_BYTE */ | ||
682 | +/* GL_SHORT */ | ||
683 | +/* GL_UNSIGNED_SHORT */ | ||
684 | +/* GL_INT */ | ||
685 | +/* GL_UNSIGNED_INT */ | ||
686 | +/* GL_FLOAT */ | ||
687 | +/* GL_2_BYTES */ | ||
688 | +/* GL_3_BYTES */ | ||
689 | +/* GL_4_BYTES */ | ||
690 | + | ||
691 | +/* LogicOp */ | ||
692 | +#define GL_CLEAR 0x1500 | ||
693 | +#define GL_AND 0x1501 | ||
694 | +#define GL_AND_REVERSE 0x1502 | ||
695 | +#define GL_COPY 0x1503 | ||
696 | +#define GL_AND_INVERTED 0x1504 | ||
697 | +#define GL_NOOP 0x1505 | ||
698 | +#define GL_XOR 0x1506 | ||
699 | +#define GL_OR 0x1507 | ||
700 | +#define GL_NOR 0x1508 | ||
701 | +#define GL_EQUIV 0x1509 | ||
702 | +#define GL_INVERT 0x150A | ||
703 | +#define GL_OR_REVERSE 0x150B | ||
704 | +#define GL_COPY_INVERTED 0x150C | ||
705 | +#define GL_OR_INVERTED 0x150D | ||
706 | +#define GL_NAND 0x150E | ||
707 | +#define GL_SET 0x150F | ||
708 | + | ||
709 | +/* MapTarget */ | ||
710 | +/* GL_MAP1_COLOR_4 */ | ||
711 | +/* GL_MAP1_INDEX */ | ||
712 | +/* GL_MAP1_NORMAL */ | ||
713 | +/* GL_MAP1_TEXTURE_COORD_1 */ | ||
714 | +/* GL_MAP1_TEXTURE_COORD_2 */ | ||
715 | +/* GL_MAP1_TEXTURE_COORD_3 */ | ||
716 | +/* GL_MAP1_TEXTURE_COORD_4 */ | ||
717 | +/* GL_MAP1_VERTEX_3 */ | ||
718 | +/* GL_MAP1_VERTEX_4 */ | ||
719 | +/* GL_MAP2_COLOR_4 */ | ||
720 | +/* GL_MAP2_INDEX */ | ||
721 | +/* GL_MAP2_NORMAL */ | ||
722 | +/* GL_MAP2_TEXTURE_COORD_1 */ | ||
723 | +/* GL_MAP2_TEXTURE_COORD_2 */ | ||
724 | +/* GL_MAP2_TEXTURE_COORD_3 */ | ||
725 | +/* GL_MAP2_TEXTURE_COORD_4 */ | ||
726 | +/* GL_MAP2_VERTEX_3 */ | ||
727 | +/* GL_MAP2_VERTEX_4 */ | ||
728 | + | ||
729 | +/* MaterialFace */ | ||
730 | +/* GL_FRONT */ | ||
731 | +/* GL_BACK */ | ||
732 | +/* GL_FRONT_AND_BACK */ | ||
733 | + | ||
734 | +/* MaterialParameter */ | ||
735 | +#define GL_EMISSION 0x1600 | ||
736 | +#define GL_SHININESS 0x1601 | ||
737 | +#define GL_AMBIENT_AND_DIFFUSE 0x1602 | ||
738 | +#define GL_COLOR_INDEXES 0x1603 | ||
739 | +/* GL_AMBIENT */ | ||
740 | +/* GL_DIFFUSE */ | ||
741 | +/* GL_SPECULAR */ | ||
742 | + | ||
743 | +/* MatrixMode */ | ||
744 | +#define GL_MODELVIEW 0x1700 | ||
745 | +#define GL_PROJECTION 0x1701 | ||
746 | +#define GL_TEXTURE 0x1702 | ||
747 | + | ||
748 | +/* MeshMode1 */ | ||
749 | +/* GL_POINT */ | ||
750 | +/* GL_LINE */ | ||
751 | + | ||
752 | +/* MeshMode2 */ | ||
753 | +/* GL_POINT */ | ||
754 | +/* GL_LINE */ | ||
755 | +/* GL_FILL */ | ||
756 | + | ||
757 | +/* NormalPointerType */ | ||
758 | +/* GL_BYTE */ | ||
759 | +/* GL_SHORT */ | ||
760 | +/* GL_INT */ | ||
761 | +/* GL_FLOAT */ | ||
762 | +/* GL_DOUBLE */ | ||
763 | + | ||
764 | +/* PixelCopyType */ | ||
765 | +#define GL_COLOR 0x1800 | ||
766 | +#define GL_DEPTH 0x1801 | ||
767 | +#define GL_STENCIL 0x1802 | ||
768 | + | ||
769 | +/* PixelFormat */ | ||
770 | +#define GL_COLOR_INDEX 0x1900 | ||
771 | +#define GL_STENCIL_INDEX 0x1901 | ||
772 | +#define GL_DEPTH_COMPONENT 0x1902 | ||
773 | +#define GL_RED 0x1903 | ||
774 | +#define GL_GREEN 0x1904 | ||
775 | +#define GL_BLUE 0x1905 | ||
776 | +#define GL_ALPHA 0x1906 | ||
777 | +#define GL_RGB 0x1907 | ||
778 | +#define GL_RGBA 0x1908 | ||
779 | +#define GL_LUMINANCE 0x1909 | ||
780 | +#define GL_LUMINANCE_ALPHA 0x190A | ||
781 | +/* GL_ABGR_EXT */ | ||
782 | + | ||
783 | +/* PixelMap */ | ||
784 | +/* GL_PIXEL_MAP_I_TO_I */ | ||
785 | +/* GL_PIXEL_MAP_S_TO_S */ | ||
786 | +/* GL_PIXEL_MAP_I_TO_R */ | ||
787 | +/* GL_PIXEL_MAP_I_TO_G */ | ||
788 | +/* GL_PIXEL_MAP_I_TO_B */ | ||
789 | +/* GL_PIXEL_MAP_I_TO_A */ | ||
790 | +/* GL_PIXEL_MAP_R_TO_R */ | ||
791 | +/* GL_PIXEL_MAP_G_TO_G */ | ||
792 | +/* GL_PIXEL_MAP_B_TO_B */ | ||
793 | +/* GL_PIXEL_MAP_A_TO_A */ | ||
794 | + | ||
795 | +/* PixelStoreParameter */ | ||
796 | +/* GL_UNPACK_SWAP_BYTES */ | ||
797 | +/* GL_UNPACK_LSB_FIRST */ | ||
798 | +/* GL_UNPACK_ROW_LENGTH */ | ||
799 | +/* GL_UNPACK_SKIP_ROWS */ | ||
800 | +/* GL_UNPACK_SKIP_PIXELS */ | ||
801 | +/* GL_UNPACK_ALIGNMENT */ | ||
802 | +/* GL_PACK_SWAP_BYTES */ | ||
803 | +/* GL_PACK_LSB_FIRST */ | ||
804 | +/* GL_PACK_ROW_LENGTH */ | ||
805 | +/* GL_PACK_SKIP_ROWS */ | ||
806 | +/* GL_PACK_SKIP_PIXELS */ | ||
807 | +/* GL_PACK_ALIGNMENT */ | ||
808 | + | ||
809 | +/* PixelTransferParameter */ | ||
810 | +/* GL_MAP_COLOR */ | ||
811 | +/* GL_MAP_STENCIL */ | ||
812 | +/* GL_INDEX_SHIFT */ | ||
813 | +/* GL_INDEX_OFFSET */ | ||
814 | +/* GL_RED_SCALE */ | ||
815 | +/* GL_RED_BIAS */ | ||
816 | +/* GL_GREEN_SCALE */ | ||
817 | +/* GL_GREEN_BIAS */ | ||
818 | +/* GL_BLUE_SCALE */ | ||
819 | +/* GL_BLUE_BIAS */ | ||
820 | +/* GL_ALPHA_SCALE */ | ||
821 | +/* GL_ALPHA_BIAS */ | ||
822 | +/* GL_DEPTH_SCALE */ | ||
823 | +/* GL_DEPTH_BIAS */ | ||
824 | + | ||
825 | +/* PixelType */ | ||
826 | +#define GL_BITMAP 0x1A00 | ||
827 | +/* GL_BYTE */ | ||
828 | +/* GL_UNSIGNED_BYTE */ | ||
829 | +/* GL_SHORT */ | ||
830 | +/* GL_UNSIGNED_SHORT */ | ||
831 | +/* GL_INT */ | ||
832 | +/* GL_UNSIGNED_INT */ | ||
833 | +/* GL_FLOAT */ | ||
834 | +/* GL_UNSIGNED_BYTE_3_3_2_EXT */ | ||
835 | +/* GL_UNSIGNED_SHORT_4_4_4_4_EXT */ | ||
836 | +/* GL_UNSIGNED_SHORT_5_5_5_1_EXT */ | ||
837 | +/* GL_UNSIGNED_INT_8_8_8_8_EXT */ | ||
838 | +/* GL_UNSIGNED_INT_10_10_10_2_EXT */ | ||
839 | + | ||
840 | +/* PolygonMode */ | ||
841 | +#define GL_POINT 0x1B00 | ||
842 | +#define GL_LINE 0x1B01 | ||
843 | +#define GL_FILL 0x1B02 | ||
844 | + | ||
845 | +/* ReadBufferMode */ | ||
846 | +/* GL_FRONT_LEFT */ | ||
847 | +/* GL_FRONT_RIGHT */ | ||
848 | +/* GL_BACK_LEFT */ | ||
849 | +/* GL_BACK_RIGHT */ | ||
850 | +/* GL_FRONT */ | ||
851 | +/* GL_BACK */ | ||
852 | +/* GL_LEFT */ | ||
853 | +/* GL_RIGHT */ | ||
854 | +/* GL_AUX0 */ | ||
855 | +/* GL_AUX1 */ | ||
856 | +/* GL_AUX2 */ | ||
857 | +/* GL_AUX3 */ | ||
858 | + | ||
859 | +/* RenderingMode */ | ||
860 | +#define GL_RENDER 0x1C00 | ||
861 | +#define GL_FEEDBACK 0x1C01 | ||
862 | +#define GL_SELECT 0x1C02 | ||
863 | + | ||
864 | +/* ShadingModel */ | ||
865 | +#define GL_FLAT 0x1D00 | ||
866 | +#define GL_SMOOTH 0x1D01 | ||
867 | + | ||
868 | +/* StencilFunction */ | ||
869 | +/* GL_NEVER */ | ||
870 | +/* GL_LESS */ | ||
871 | +/* GL_EQUAL */ | ||
872 | +/* GL_LEQUAL */ | ||
873 | +/* GL_GREATER */ | ||
874 | +/* GL_NOTEQUAL */ | ||
875 | +/* GL_GEQUAL */ | ||
876 | +/* GL_ALWAYS */ | ||
877 | + | ||
878 | +/* StencilOp */ | ||
879 | +/* GL_ZERO */ | ||
880 | +#define GL_KEEP 0x1E00 | ||
881 | +#define GL_REPLACE 0x1E01 | ||
882 | +#define GL_INCR 0x1E02 | ||
883 | +#define GL_DECR 0x1E03 | ||
884 | +/* GL_INVERT */ | ||
885 | + | ||
886 | +/* StringName */ | ||
887 | +#define GL_VENDOR 0x1F00 | ||
888 | +#define GL_RENDERER 0x1F01 | ||
889 | +#define GL_VERSION 0x1F02 | ||
890 | +#define GL_EXTENSIONS 0x1F03 | ||
891 | + | ||
892 | +/* TexCoordPointerType */ | ||
893 | +/* GL_SHORT */ | ||
894 | +/* GL_INT */ | ||
895 | +/* GL_FLOAT */ | ||
896 | +/* GL_DOUBLE */ | ||
897 | + | ||
898 | +/* TextureCoordName */ | ||
899 | +#define GL_S 0x2000 | ||
900 | +#define GL_T 0x2001 | ||
901 | +#define GL_R 0x2002 | ||
902 | +#define GL_Q 0x2003 | ||
903 | + | ||
904 | +/* TextureEnvMode */ | ||
905 | +#define GL_MODULATE 0x2100 | ||
906 | +#define GL_DECAL 0x2101 | ||
907 | +/* GL_BLEND */ | ||
908 | +/* GL_REPLACE */ | ||
909 | +/* GL_ADD */ | ||
910 | + | ||
911 | +/* TextureEnvParameter */ | ||
912 | +#define GL_TEXTURE_ENV_MODE 0x2200 | ||
913 | +#define GL_TEXTURE_ENV_COLOR 0x2201 | ||
914 | + | ||
915 | +/* TextureEnvTarget */ | ||
916 | +#define GL_TEXTURE_ENV 0x2300 | ||
917 | + | ||
918 | +/* TextureGenMode */ | ||
919 | +#define GL_EYE_LINEAR 0x2400 | ||
920 | +#define GL_OBJECT_LINEAR 0x2401 | ||
921 | +#define GL_SPHERE_MAP 0x2402 | ||
922 | + | ||
923 | +/* TextureGenParameter */ | ||
924 | +#define GL_TEXTURE_GEN_MODE 0x2500 | ||
925 | +#define GL_OBJECT_PLANE 0x2501 | ||
926 | +#define GL_EYE_PLANE 0x2502 | ||
927 | + | ||
928 | +/* TextureMagFilter */ | ||
929 | +#define GL_NEAREST 0x2600 | ||
930 | +#define GL_LINEAR 0x2601 | ||
931 | + | ||
932 | +/* TextureMinFilter */ | ||
933 | +/* GL_NEAREST */ | ||
934 | +/* GL_LINEAR */ | ||
935 | +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 | ||
936 | +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 | ||
937 | +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 | ||
938 | +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 | ||
939 | + | ||
940 | +/* TextureParameterName */ | ||
941 | +#define GL_TEXTURE_MAG_FILTER 0x2800 | ||
942 | +#define GL_TEXTURE_MIN_FILTER 0x2801 | ||
943 | +#define GL_TEXTURE_WRAP_S 0x2802 | ||
944 | +#define GL_TEXTURE_WRAP_T 0x2803 | ||
945 | +/* GL_TEXTURE_BORDER_COLOR */ | ||
946 | +/* GL_TEXTURE_PRIORITY */ | ||
947 | + | ||
948 | +/* TextureTarget */ | ||
949 | +/* GL_TEXTURE_1D */ | ||
950 | +/* GL_TEXTURE_2D */ | ||
951 | +#define GL_PROXY_TEXTURE_1D 0x8063 | ||
952 | +#define GL_PROXY_TEXTURE_2D 0x8064 | ||
953 | + | ||
954 | +/* TextureWrapMode */ | ||
955 | +#define GL_CLAMP 0x2900 | ||
956 | +#define GL_REPEAT 0x2901 | ||
957 | + | ||
958 | +/* PixelInternalFormat */ | ||
959 | +#define GL_R3_G3_B2 0x2A10 | ||
960 | +#define GL_ALPHA4 0x803B | ||
961 | +#define GL_ALPHA8 0x803C | ||
962 | +#define GL_ALPHA12 0x803D | ||
963 | +#define GL_ALPHA16 0x803E | ||
964 | +#define GL_LUMINANCE4 0x803F | ||
965 | +#define GL_LUMINANCE8 0x8040 | ||
966 | +#define GL_LUMINANCE12 0x8041 | ||
967 | +#define GL_LUMINANCE16 0x8042 | ||
968 | +#define GL_LUMINANCE4_ALPHA4 0x8043 | ||
969 | +#define GL_LUMINANCE6_ALPHA2 0x8044 | ||
970 | +#define GL_LUMINANCE8_ALPHA8 0x8045 | ||
971 | +#define GL_LUMINANCE12_ALPHA4 0x8046 | ||
972 | +#define GL_LUMINANCE12_ALPHA12 0x8047 | ||
973 | +#define GL_LUMINANCE16_ALPHA16 0x8048 | ||
974 | +#define GL_INTENSITY 0x8049 | ||
975 | +#define GL_INTENSITY4 0x804A | ||
976 | +#define GL_INTENSITY8 0x804B | ||
977 | +#define GL_INTENSITY12 0x804C | ||
978 | +#define GL_INTENSITY16 0x804D | ||
979 | +#define GL_RGB4 0x804F | ||
980 | +#define GL_RGB5 0x8050 | ||
981 | +#define GL_RGB8 0x8051 | ||
982 | +#define GL_RGB10 0x8052 | ||
983 | +#define GL_RGB12 0x8053 | ||
984 | +#define GL_RGB16 0x8054 | ||
985 | +#define GL_RGBA2 0x8055 | ||
986 | +#define GL_RGBA4 0x8056 | ||
987 | +#define GL_RGB5_A1 0x8057 | ||
988 | +#define GL_RGBA8 0x8058 | ||
989 | +#define GL_RGB10_A2 0x8059 | ||
990 | +#define GL_RGBA12 0x805A | ||
991 | +#define GL_RGBA16 0x805B | ||
992 | + | ||
993 | +/* InterleavedArrayFormat */ | ||
994 | +#define GL_V2F 0x2A20 | ||
995 | +#define GL_V3F 0x2A21 | ||
996 | +#define GL_C4UB_V2F 0x2A22 | ||
997 | +#define GL_C4UB_V3F 0x2A23 | ||
998 | +#define GL_C3F_V3F 0x2A24 | ||
999 | +#define GL_N3F_V3F 0x2A25 | ||
1000 | +#define GL_C4F_N3F_V3F 0x2A26 | ||
1001 | +#define GL_T2F_V3F 0x2A27 | ||
1002 | +#define GL_T4F_V4F 0x2A28 | ||
1003 | +#define GL_T2F_C4UB_V3F 0x2A29 | ||
1004 | +#define GL_T2F_C3F_V3F 0x2A2A | ||
1005 | +#define GL_T2F_N3F_V3F 0x2A2B | ||
1006 | +#define GL_T2F_C4F_N3F_V3F 0x2A2C | ||
1007 | +#define GL_T4F_C4F_N3F_V4F 0x2A2D | ||
1008 | + | ||
1009 | +/* VertexPointerType */ | ||
1010 | +/* GL_SHORT */ | ||
1011 | +/* GL_INT */ | ||
1012 | +/* GL_FLOAT */ | ||
1013 | +/* GL_DOUBLE */ | ||
1014 | + | ||
1015 | +/* ClipPlaneName */ | ||
1016 | +#define GL_CLIP_PLANE0 0x3000 | ||
1017 | +#define GL_CLIP_PLANE1 0x3001 | ||
1018 | +#define GL_CLIP_PLANE2 0x3002 | ||
1019 | +#define GL_CLIP_PLANE3 0x3003 | ||
1020 | +#define GL_CLIP_PLANE4 0x3004 | ||
1021 | +#define GL_CLIP_PLANE5 0x3005 | ||
1022 | + | ||
1023 | +/* LightName */ | ||
1024 | +#define GL_LIGHT0 0x4000 | ||
1025 | +#define GL_LIGHT1 0x4001 | ||
1026 | +#define GL_LIGHT2 0x4002 | ||
1027 | +#define GL_LIGHT3 0x4003 | ||
1028 | +#define GL_LIGHT4 0x4004 | ||
1029 | +#define GL_LIGHT5 0x4005 | ||
1030 | +#define GL_LIGHT6 0x4006 | ||
1031 | +#define GL_LIGHT7 0x4007 | ||
1032 | + | ||
1033 | +/* EXT_abgr */ | ||
1034 | +#define GL_ABGR_EXT 0x8000 | ||
1035 | + | ||
1036 | +/* EXT_blend_subtract */ | ||
1037 | +#define GL_FUNC_SUBTRACT_EXT 0x800A | ||
1038 | +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B | ||
1039 | + | ||
1040 | +/* EXT_packed_pixels */ | ||
1041 | +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 | ||
1042 | +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 | ||
1043 | +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 | ||
1044 | +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 | ||
1045 | +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 | ||
1046 | + | ||
1047 | +/* OpenGL12 */ | ||
1048 | +#define GL_PACK_SKIP_IMAGES 0x806B | ||
1049 | +#define GL_PACK_IMAGE_HEIGHT 0x806C | ||
1050 | +#define GL_UNPACK_SKIP_IMAGES 0x806D | ||
1051 | +#define GL_UNPACK_IMAGE_HEIGHT 0x806E | ||
1052 | +#define GL_TEXTURE_3D 0x806F | ||
1053 | +#define GL_PROXY_TEXTURE_3D 0x8070 | ||
1054 | +#define GL_TEXTURE_DEPTH 0x8071 | ||
1055 | +#define GL_TEXTURE_WRAP_R 0x8072 | ||
1056 | +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 | ||
1057 | +#define GL_BGR 0x80E0 | ||
1058 | +#define GL_BGRA 0x80E1 | ||
1059 | +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 | ||
1060 | +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 | ||
1061 | +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 | ||
1062 | +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 | ||
1063 | +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 | ||
1064 | +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 | ||
1065 | +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 | ||
1066 | +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 | ||
1067 | +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 | ||
1068 | +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 | ||
1069 | +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 | ||
1070 | +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 | ||
1071 | +#define GL_RESCALE_NORMAL 0x803A | ||
1072 | +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 | ||
1073 | +#define GL_SINGLE_COLOR 0x81F9 | ||
1074 | +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA | ||
1075 | +#define GL_CLAMP_TO_EDGE 0x812F | ||
1076 | +#define GL_TEXTURE_MIN_LOD 0x813A | ||
1077 | +#define GL_TEXTURE_MAX_LOD 0x813B | ||
1078 | +#define GL_TEXTURE_BASE_LEVEL 0x813C | ||
1079 | +#define GL_TEXTURE_MAX_LEVEL 0x813D | ||
1080 | +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 | ||
1081 | +#define GL_MAX_ELEMENTS_INDICES 0x80E9 | ||
1082 | +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D | ||
1083 | +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E | ||
1084 | + | ||
1085 | +/* OpenGL13 */ | ||
1086 | +#define GL_ACTIVE_TEXTURE 0x84E0 | ||
1087 | +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 | ||
1088 | +#define GL_MAX_TEXTURE_UNITS 0x84E2 | ||
1089 | +#define GL_TEXTURE0 0x84C0 | ||
1090 | +#define GL_TEXTURE1 0x84C1 | ||
1091 | +#define GL_TEXTURE2 0x84C2 | ||
1092 | +#define GL_TEXTURE3 0x84C3 | ||
1093 | +#define GL_TEXTURE4 0x84C4 | ||
1094 | +#define GL_TEXTURE5 0x84C5 | ||
1095 | +#define GL_TEXTURE6 0x84C6 | ||
1096 | +#define GL_TEXTURE7 0x84C7 | ||
1097 | +#define GL_TEXTURE8 0x84C8 | ||
1098 | +#define GL_TEXTURE9 0x84C9 | ||
1099 | +#define GL_TEXTURE10 0x84CA | ||
1100 | +#define GL_TEXTURE11 0x84CB | ||
1101 | +#define GL_TEXTURE12 0x84CC | ||
1102 | +#define GL_TEXTURE13 0x84CD | ||
1103 | +#define GL_TEXTURE14 0x84CE | ||
1104 | +#define GL_TEXTURE15 0x84CF | ||
1105 | +#define GL_TEXTURE16 0x84D0 | ||
1106 | +#define GL_TEXTURE17 0x84D1 | ||
1107 | +#define GL_TEXTURE18 0x84D2 | ||
1108 | +#define GL_TEXTURE19 0x84D3 | ||
1109 | +#define GL_TEXTURE20 0x84D4 | ||
1110 | +#define GL_TEXTURE21 0x84D5 | ||
1111 | +#define GL_TEXTURE22 0x84D6 | ||
1112 | +#define GL_TEXTURE23 0x84D7 | ||
1113 | +#define GL_TEXTURE24 0x84D8 | ||
1114 | +#define GL_TEXTURE25 0x84D9 | ||
1115 | +#define GL_TEXTURE26 0x84DA | ||
1116 | +#define GL_TEXTURE27 0x84DB | ||
1117 | +#define GL_TEXTURE28 0x84DC | ||
1118 | +#define GL_TEXTURE29 0x84DD | ||
1119 | +#define GL_TEXTURE30 0x84DE | ||
1120 | +#define GL_TEXTURE31 0x84DF | ||
1121 | +#define GL_NORMAL_MAP 0x8511 | ||
1122 | +#define GL_REFLECTION_MAP 0x8512 | ||
1123 | +#define GL_TEXTURE_CUBE_MAP 0x8513 | ||
1124 | +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 | ||
1125 | +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 | ||
1126 | +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 | ||
1127 | +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 | ||
1128 | +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 | ||
1129 | +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 | ||
1130 | +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A | ||
1131 | +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B | ||
1132 | +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C | ||
1133 | +#define GL_COMBINE 0x8570 | ||
1134 | +#define GL_COMBINE_RGB 0x8571 | ||
1135 | +#define GL_COMBINE_ALPHA 0x8572 | ||
1136 | +#define GL_RGB_SCALE 0x8573 | ||
1137 | +#define GL_ADD_SIGNED 0x8574 | ||
1138 | +#define GL_INTERPOLATE 0x8575 | ||
1139 | +#define GL_CONSTANT 0x8576 | ||
1140 | +#define GL_PRIMARY_COLOR 0x8577 | ||
1141 | +#define GL_PREVIOUS 0x8578 | ||
1142 | +#define GL_SOURCE0_RGB 0x8580 | ||
1143 | +#define GL_SOURCE1_RGB 0x8581 | ||
1144 | +#define GL_SOURCE2_RGB 0x8582 | ||
1145 | +#define GL_SOURCE0_ALPHA 0x8588 | ||
1146 | +#define GL_SOURCE1_ALPHA 0x8589 | ||
1147 | +#define GL_SOURCE2_ALPHA 0x858A | ||
1148 | +#define GL_OPERAND0_RGB 0x8590 | ||
1149 | +#define GL_OPERAND1_RGB 0x8591 | ||
1150 | +#define GL_OPERAND2_RGB 0x8592 | ||
1151 | +#define GL_OPERAND0_ALPHA 0x8598 | ||
1152 | +#define GL_OPERAND1_ALPHA 0x8599 | ||
1153 | +#define GL_OPERAND2_ALPHA 0x859A | ||
1154 | +#define GL_SUBTRACT 0x84E7 | ||
1155 | +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 | ||
1156 | +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 | ||
1157 | +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 | ||
1158 | +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 | ||
1159 | +#define GL_COMPRESSED_ALPHA 0x84E9 | ||
1160 | +#define GL_COMPRESSED_LUMINANCE 0x84EA | ||
1161 | +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB | ||
1162 | +#define GL_COMPRESSED_INTENSITY 0x84EC | ||
1163 | +#define GL_COMPRESSED_RGB 0x84ED | ||
1164 | +#define GL_COMPRESSED_RGBA 0x84EE | ||
1165 | +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF | ||
1166 | +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 | ||
1167 | +#define GL_TEXTURE_COMPRESSED 0x86A1 | ||
1168 | +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 | ||
1169 | +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 | ||
1170 | +#define GL_DOT3_RGB 0x86AE | ||
1171 | +#define GL_DOT3_RGBA 0x86AF | ||
1172 | +#define GL_CLAMP_TO_BORDER 0x812D | ||
1173 | +#define GL_MULTISAMPLE 0x809D | ||
1174 | +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E | ||
1175 | +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F | ||
1176 | +#define GL_SAMPLE_COVERAGE 0x80A0 | ||
1177 | +#define GL_SAMPLE_BUFFERS 0x80A8 | ||
1178 | +#define GL_SAMPLES 0x80A9 | ||
1179 | +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA | ||
1180 | +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB | ||
1181 | +#define GL_MULTISAMPLE_BIT 0x20000000 | ||
1182 | + | ||
1183 | +/* EXT_vertex_array */ | ||
1184 | +#define GL_VERTEX_ARRAY_EXT 0x8074 | ||
1185 | +#define GL_NORMAL_ARRAY_EXT 0x8075 | ||
1186 | +#define GL_COLOR_ARRAY_EXT 0x8076 | ||
1187 | +#define GL_INDEX_ARRAY_EXT 0x8077 | ||
1188 | +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 | ||
1189 | +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 | ||
1190 | +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A | ||
1191 | +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B | ||
1192 | +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C | ||
1193 | +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D | ||
1194 | +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E | ||
1195 | +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F | ||
1196 | +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 | ||
1197 | +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 | ||
1198 | +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 | ||
1199 | +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 | ||
1200 | +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 | ||
1201 | +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 | ||
1202 | +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 | ||
1203 | +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 | ||
1204 | +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 | ||
1205 | +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 | ||
1206 | +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A | ||
1207 | +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B | ||
1208 | +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C | ||
1209 | +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D | ||
1210 | +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E | ||
1211 | +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F | ||
1212 | +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 | ||
1213 | +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 | ||
1214 | +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 | ||
1215 | +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 | ||
1216 | + | ||
1217 | +/* SGIS_texture_lod */ | ||
1218 | +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A | ||
1219 | +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B | ||
1220 | +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C | ||
1221 | +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D | ||
1222 | + | ||
1223 | +/* EXT_shared_texture_palette */ | ||
1224 | +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB | ||
1225 | + | ||
1226 | +/* EXT_rescale_normal */ | ||
1227 | +#define GL_RESCALE_NORMAL_EXT 0x803A | ||
1228 | + | ||
1229 | +/* SGIX_shadow */ | ||
1230 | +#define GL_TEXTURE_COMPARE_SGIX 0x819A | ||
1231 | +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B | ||
1232 | +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C | ||
1233 | +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D | ||
1234 | + | ||
1235 | +/* SGIX_depth_texture */ | ||
1236 | +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 | ||
1237 | +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 | ||
1238 | +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 | ||
1239 | + | ||
1240 | +/* SGIS_generate_mipmap */ | ||
1241 | +#define GL_GENERATE_MIPMAP_SGIS 0x8191 | ||
1242 | +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 | ||
1243 | + | ||
1244 | +/* OpenGL14 */ | ||
1245 | +#define GL_POINT_SIZE_MIN 0x8126 | ||
1246 | +#define GL_POINT_SIZE_MAX 0x8127 | ||
1247 | +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 | ||
1248 | +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 | ||
1249 | +#define GL_FOG_COORDINATE_SOURCE 0x8450 | ||
1250 | +#define GL_FOG_COORDINATE 0x8451 | ||
1251 | +#define GL_FRAGMENT_DEPTH 0x8452 | ||
1252 | +#define GL_CURRENT_FOG_COORDINATE 0x8453 | ||
1253 | +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 | ||
1254 | +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 | ||
1255 | +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 | ||
1256 | +#define GL_FOG_COORDINATE_ARRAY 0x8457 | ||
1257 | +#define GL_COLOR_SUM 0x8458 | ||
1258 | +#define GL_CURRENT_SECONDARY_COLOR 0x8459 | ||
1259 | +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A | ||
1260 | +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B | ||
1261 | +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C | ||
1262 | +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D | ||
1263 | +#define GL_SECONDARY_COLOR_ARRAY 0x845E | ||
1264 | +#define GL_INCR_WRAP 0x8507 | ||
1265 | +#define GL_DECR_WRAP 0x8508 | ||
1266 | +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD | ||
1267 | +#define GL_TEXTURE_FILTER_CONTROL 0x8500 | ||
1268 | +#define GL_TEXTURE_LOD_BIAS 0x8501 | ||
1269 | +#define GL_GENERATE_MIPMAP 0x8191 | ||
1270 | +#define GL_GENERATE_MIPMAP_HINT 0x8192 | ||
1271 | +#define GL_BLEND_DST_RGB 0x80C8 | ||
1272 | +#define GL_BLEND_SRC_RGB 0x80C9 | ||
1273 | +#define GL_BLEND_DST_ALPHA 0x80CA | ||
1274 | +#define GL_BLEND_SRC_ALPHA 0x80CB | ||
1275 | +#define GL_MIRRORED_REPEAT 0x8370 | ||
1276 | +#define GL_DEPTH_COMPONENT16 0x81A5 | ||
1277 | +#define GL_DEPTH_COMPONENT24 0x81A6 | ||
1278 | +#define GL_DEPTH_COMPONENT32 0x81A7 | ||
1279 | +#define GL_TEXTURE_DEPTH_SIZE 0x884A | ||
1280 | +#define GL_DEPTH_TEXTURE_MODE 0x884B | ||
1281 | +#define GL_TEXTURE_COMPARE_MODE 0x884C | ||
1282 | +#define GL_TEXTURE_COMPARE_FUNC 0x884D | ||
1283 | +#define GL_COMPARE_R_TO_TEXTURE 0x884E | ||
1284 | + | ||
1285 | +/*************************************************************/ | ||
1286 | + | ||
1287 | +WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value); | ||
1288 | +WINGDIAPI void APIENTRY glAlphaFunc (GLenum func, GLclampf ref); | ||
1289 | +WINGDIAPI GLboolean APIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); | ||
1290 | +WINGDIAPI void APIENTRY glArrayElement (GLint i); | ||
1291 | +WINGDIAPI void APIENTRY glBegin (GLenum mode); | ||
1292 | +WINGDIAPI void APIENTRY glBindTexture (GLenum target, GLuint texture); | ||
1293 | +WINGDIAPI void APIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); | ||
1294 | +WINGDIAPI void APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); | ||
1295 | +WINGDIAPI void APIENTRY glCallList (GLuint list); | ||
1296 | +WINGDIAPI void APIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists); | ||
1297 | +WINGDIAPI void APIENTRY glClear (GLbitfield mask); | ||
1298 | +WINGDIAPI void APIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); | ||
1299 | +WINGDIAPI void APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); | ||
1300 | +WINGDIAPI void APIENTRY glClearDepth (GLclampd depth); | ||
1301 | +WINGDIAPI void APIENTRY glClearIndex (GLfloat c); | ||
1302 | +WINGDIAPI void APIENTRY glClearStencil (GLint s); | ||
1303 | +WINGDIAPI void APIENTRY glClipPlane (GLenum plane, const GLdouble *equation); | ||
1304 | +WINGDIAPI void APIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); | ||
1305 | +WINGDIAPI void APIENTRY glColor3bv (const GLbyte *v); | ||
1306 | +WINGDIAPI void APIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); | ||
1307 | +WINGDIAPI void APIENTRY glColor3dv (const GLdouble *v); | ||
1308 | +WINGDIAPI void APIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); | ||
1309 | +WINGDIAPI void APIENTRY glColor3fv (const GLfloat *v); | ||
1310 | +WINGDIAPI void APIENTRY glColor3i (GLint red, GLint green, GLint blue); | ||
1311 | +WINGDIAPI void APIENTRY glColor3iv (const GLint *v); | ||
1312 | +WINGDIAPI void APIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); | ||
1313 | +WINGDIAPI void APIENTRY glColor3sv (const GLshort *v); | ||
1314 | +WINGDIAPI void APIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); | ||
1315 | +WINGDIAPI void APIENTRY glColor3ubv (const GLubyte *v); | ||
1316 | +WINGDIAPI void APIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); | ||
1317 | +WINGDIAPI void APIENTRY glColor3uiv (const GLuint *v); | ||
1318 | +WINGDIAPI void APIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); | ||
1319 | +WINGDIAPI void APIENTRY glColor3usv (const GLushort *v); | ||
1320 | +WINGDIAPI void APIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); | ||
1321 | +WINGDIAPI void APIENTRY glColor4bv (const GLbyte *v); | ||
1322 | +WINGDIAPI void APIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); | ||
1323 | +WINGDIAPI void APIENTRY glColor4dv (const GLdouble *v); | ||
1324 | +WINGDIAPI void APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); | ||
1325 | +WINGDIAPI void APIENTRY glColor4fv (const GLfloat *v); | ||
1326 | +WINGDIAPI void APIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); | ||
1327 | +WINGDIAPI void APIENTRY glColor4iv (const GLint *v); | ||
1328 | +WINGDIAPI void APIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); | ||
1329 | +WINGDIAPI void APIENTRY glColor4sv (const GLshort *v); | ||
1330 | +WINGDIAPI void APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); | ||
1331 | +WINGDIAPI void APIENTRY glColor4ubv (const GLubyte *v); | ||
1332 | +WINGDIAPI void APIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); | ||
1333 | +WINGDIAPI void APIENTRY glColor4uiv (const GLuint *v); | ||
1334 | +WINGDIAPI void APIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); | ||
1335 | +WINGDIAPI void APIENTRY glColor4usv (const GLushort *v); | ||
1336 | +WINGDIAPI void APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); | ||
1337 | +WINGDIAPI void APIENTRY glColorMaterial (GLenum face, GLenum mode); | ||
1338 | +WINGDIAPI void APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); | ||
1339 | +WINGDIAPI void APIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); | ||
1340 | +WINGDIAPI void APIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); | ||
1341 | +WINGDIAPI void APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); | ||
1342 | +WINGDIAPI void APIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); | ||
1343 | +WINGDIAPI void APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); | ||
1344 | +WINGDIAPI void APIENTRY glCullFace (GLenum mode); | ||
1345 | +WINGDIAPI void APIENTRY glDeleteLists (GLuint list, GLsizei range); | ||
1346 | +WINGDIAPI void APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); | ||
1347 | +WINGDIAPI void APIENTRY glDepthFunc (GLenum func); | ||
1348 | +WINGDIAPI void APIENTRY glDepthMask (GLboolean flag); | ||
1349 | +WINGDIAPI void APIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); | ||
1350 | +WINGDIAPI void APIENTRY glDisable (GLenum cap); | ||
1351 | +WINGDIAPI void APIENTRY glDisableClientState (GLenum array); | ||
1352 | +WINGDIAPI void APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); | ||
1353 | +WINGDIAPI void APIENTRY glDrawBuffer (GLenum mode); | ||
1354 | +WINGDIAPI void APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); | ||
1355 | +WINGDIAPI void APIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); | ||
1356 | +WINGDIAPI void APIENTRY glEdgeFlag (GLboolean flag); | ||
1357 | +WINGDIAPI void APIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer); | ||
1358 | +WINGDIAPI void APIENTRY glEdgeFlagv (const GLboolean *flag); | ||
1359 | +WINGDIAPI void APIENTRY glEnable (GLenum cap); | ||
1360 | +WINGDIAPI void APIENTRY glEnableClientState (GLenum array); | ||
1361 | +WINGDIAPI void APIENTRY glEnd (void); | ||
1362 | +WINGDIAPI void APIENTRY glEndList (void); | ||
1363 | +WINGDIAPI void APIENTRY glEvalCoord1d (GLdouble u); | ||
1364 | +WINGDIAPI void APIENTRY glEvalCoord1dv (const GLdouble *u); | ||
1365 | +WINGDIAPI void APIENTRY glEvalCoord1f (GLfloat u); | ||
1366 | +WINGDIAPI void APIENTRY glEvalCoord1fv (const GLfloat *u); | ||
1367 | +WINGDIAPI void APIENTRY glEvalCoord2d (GLdouble u, GLdouble v); | ||
1368 | +WINGDIAPI void APIENTRY glEvalCoord2dv (const GLdouble *u); | ||
1369 | +WINGDIAPI void APIENTRY glEvalCoord2f (GLfloat u, GLfloat v); | ||
1370 | +WINGDIAPI void APIENTRY glEvalCoord2fv (const GLfloat *u); | ||
1371 | +WINGDIAPI void APIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); | ||
1372 | +WINGDIAPI void APIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); | ||
1373 | +WINGDIAPI void APIENTRY glEvalPoint1 (GLint i); | ||
1374 | +WINGDIAPI void APIENTRY glEvalPoint2 (GLint i, GLint j); | ||
1375 | +WINGDIAPI void APIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); | ||
1376 | +WINGDIAPI void APIENTRY glFinish (void); | ||
1377 | +WINGDIAPI void APIENTRY glFlush (void); | ||
1378 | +WINGDIAPI void APIENTRY glFogf (GLenum pname, GLfloat param); | ||
1379 | +WINGDIAPI void APIENTRY glFogfv (GLenum pname, const GLfloat *params); | ||
1380 | +WINGDIAPI void APIENTRY glFogi (GLenum pname, GLint param); | ||
1381 | +WINGDIAPI void APIENTRY glFogiv (GLenum pname, const GLint *params); | ||
1382 | +WINGDIAPI void APIENTRY glFrontFace (GLenum mode); | ||
1383 | +WINGDIAPI void APIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); | ||
1384 | +WINGDIAPI GLuint APIENTRY glGenLists (GLsizei range); | ||
1385 | +WINGDIAPI void APIENTRY glGenTextures (GLsizei n, GLuint *textures); | ||
1386 | +WINGDIAPI void APIENTRY glGetBooleanv (GLenum pname, GLboolean *params); | ||
1387 | +WINGDIAPI void APIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); | ||
1388 | +WINGDIAPI void APIENTRY glGetDoublev (GLenum pname, GLdouble *params); | ||
1389 | +WINGDIAPI GLenum APIENTRY glGetError (void); | ||
1390 | +WINGDIAPI void APIENTRY glGetFloatv (GLenum pname, GLfloat *params); | ||
1391 | +WINGDIAPI void APIENTRY glGetIntegerv (GLenum pname, GLint *params); | ||
1392 | +WINGDIAPI void APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); | ||
1393 | +WINGDIAPI void APIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); | ||
1394 | +WINGDIAPI void APIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); | ||
1395 | +WINGDIAPI void APIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); | ||
1396 | +WINGDIAPI void APIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); | ||
1397 | +WINGDIAPI void APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); | ||
1398 | +WINGDIAPI void APIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); | ||
1399 | +WINGDIAPI void APIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); | ||
1400 | +WINGDIAPI void APIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); | ||
1401 | +WINGDIAPI void APIENTRY glGetPixelMapusv (GLenum map, GLushort *values); | ||
1402 | +WINGDIAPI void APIENTRY glGetPointerv (GLenum pname, GLvoid* *params); | ||
1403 | +WINGDIAPI void APIENTRY glGetPolygonStipple (GLubyte *mask); | ||
1404 | +WINGDIAPI const GLubyte * APIENTRY glGetString (GLenum name); | ||
1405 | +WINGDIAPI void APIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); | ||
1406 | +WINGDIAPI void APIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); | ||
1407 | +WINGDIAPI void APIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); | ||
1408 | +WINGDIAPI void APIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); | ||
1409 | +WINGDIAPI void APIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); | ||
1410 | +WINGDIAPI void APIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); | ||
1411 | +WINGDIAPI void APIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); | ||
1412 | +WINGDIAPI void APIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); | ||
1413 | +WINGDIAPI void APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); | ||
1414 | +WINGDIAPI void APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); | ||
1415 | +WINGDIAPI void APIENTRY glHint (GLenum target, GLenum mode); | ||
1416 | +WINGDIAPI void APIENTRY glIndexMask (GLuint mask); | ||
1417 | +WINGDIAPI void APIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer); | ||
1418 | +WINGDIAPI void APIENTRY glIndexd (GLdouble c); | ||
1419 | +WINGDIAPI void APIENTRY glIndexdv (const GLdouble *c); | ||
1420 | +WINGDIAPI void APIENTRY glIndexf (GLfloat c); | ||
1421 | +WINGDIAPI void APIENTRY glIndexfv (const GLfloat *c); | ||
1422 | +WINGDIAPI void APIENTRY glIndexi (GLint c); | ||
1423 | +WINGDIAPI void APIENTRY glIndexiv (const GLint *c); | ||
1424 | +WINGDIAPI void APIENTRY glIndexs (GLshort c); | ||
1425 | +WINGDIAPI void APIENTRY glIndexsv (const GLshort *c); | ||
1426 | +WINGDIAPI void APIENTRY glIndexub (GLubyte c); | ||
1427 | +WINGDIAPI void APIENTRY glIndexubv (const GLubyte *c); | ||
1428 | +WINGDIAPI void APIENTRY glInitNames (void); | ||
1429 | +WINGDIAPI void APIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer); | ||
1430 | +WINGDIAPI GLboolean APIENTRY glIsEnabled (GLenum cap); | ||
1431 | +WINGDIAPI GLboolean APIENTRY glIsList (GLuint list); | ||
1432 | +WINGDIAPI GLboolean APIENTRY glIsTexture (GLuint texture); | ||
1433 | +WINGDIAPI void APIENTRY glLightModelf (GLenum pname, GLfloat param); | ||
1434 | +WINGDIAPI void APIENTRY glLightModelfv (GLenum pname, const GLfloat *params); | ||
1435 | +WINGDIAPI void APIENTRY glLightModeli (GLenum pname, GLint param); | ||
1436 | +WINGDIAPI void APIENTRY glLightModeliv (GLenum pname, const GLint *params); | ||
1437 | +WINGDIAPI void APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); | ||
1438 | +WINGDIAPI void APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); | ||
1439 | +WINGDIAPI void APIENTRY glLighti (GLenum light, GLenum pname, GLint param); | ||
1440 | +WINGDIAPI void APIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); | ||
1441 | +WINGDIAPI void APIENTRY glLineStipple (GLint factor, GLushort pattern); | ||
1442 | +WINGDIAPI void APIENTRY glLineWidth (GLfloat width); | ||
1443 | +WINGDIAPI void APIENTRY glListBase (GLuint base); | ||
1444 | +WINGDIAPI void APIENTRY glLoadIdentity (void); | ||
1445 | +WINGDIAPI void APIENTRY glLoadMatrixd (const GLdouble *m); | ||
1446 | +WINGDIAPI void APIENTRY glLoadMatrixf (const GLfloat *m); | ||
1447 | +WINGDIAPI void APIENTRY glLoadName (GLuint name); | ||
1448 | +WINGDIAPI void APIENTRY glLogicOp (GLenum opcode); | ||
1449 | +WINGDIAPI void APIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); | ||
1450 | +WINGDIAPI void APIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); | ||
1451 | +WINGDIAPI void APIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); | ||
1452 | +WINGDIAPI void APIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); | ||
1453 | +WINGDIAPI void APIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); | ||
1454 | +WINGDIAPI void APIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); | ||
1455 | +WINGDIAPI void APIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); | ||
1456 | +WINGDIAPI void APIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); | ||
1457 | +WINGDIAPI void APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); | ||
1458 | +WINGDIAPI void APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); | ||
1459 | +WINGDIAPI void APIENTRY glMateriali (GLenum face, GLenum pname, GLint param); | ||
1460 | +WINGDIAPI void APIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); | ||
1461 | +WINGDIAPI void APIENTRY glMatrixMode (GLenum mode); | ||
1462 | +WINGDIAPI void APIENTRY glMultMatrixd (const GLdouble *m); | ||
1463 | +WINGDIAPI void APIENTRY glMultMatrixf (const GLfloat *m); | ||
1464 | +WINGDIAPI void APIENTRY glNewList (GLuint list, GLenum mode); | ||
1465 | +WINGDIAPI void APIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); | ||
1466 | +WINGDIAPI void APIENTRY glNormal3bv (const GLbyte *v); | ||
1467 | +WINGDIAPI void APIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); | ||
1468 | +WINGDIAPI void APIENTRY glNormal3dv (const GLdouble *v); | ||
1469 | +WINGDIAPI void APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); | ||
1470 | +WINGDIAPI void APIENTRY glNormal3fv (const GLfloat *v); | ||
1471 | +WINGDIAPI void APIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); | ||
1472 | +WINGDIAPI void APIENTRY glNormal3iv (const GLint *v); | ||
1473 | +WINGDIAPI void APIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); | ||
1474 | +WINGDIAPI void APIENTRY glNormal3sv (const GLshort *v); | ||
1475 | +WINGDIAPI void APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); | ||
1476 | +WINGDIAPI void APIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); | ||
1477 | +WINGDIAPI void APIENTRY glPassThrough (GLfloat token); | ||
1478 | +WINGDIAPI void APIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); | ||
1479 | +WINGDIAPI void APIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); | ||
1480 | +WINGDIAPI void APIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); | ||
1481 | +WINGDIAPI void APIENTRY glPixelStoref (GLenum pname, GLfloat param); | ||
1482 | +WINGDIAPI void APIENTRY glPixelStorei (GLenum pname, GLint param); | ||
1483 | +WINGDIAPI void APIENTRY glPixelTransferf (GLenum pname, GLfloat param); | ||
1484 | +WINGDIAPI void APIENTRY glPixelTransferi (GLenum pname, GLint param); | ||
1485 | +WINGDIAPI void APIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); | ||
1486 | +WINGDIAPI void APIENTRY glPointSize (GLfloat size); | ||
1487 | +WINGDIAPI void APIENTRY glPolygonMode (GLenum face, GLenum mode); | ||
1488 | +WINGDIAPI void APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); | ||
1489 | +WINGDIAPI void APIENTRY glPolygonStipple (const GLubyte *mask); | ||
1490 | +WINGDIAPI void APIENTRY glPopAttrib (void); | ||
1491 | +WINGDIAPI void APIENTRY glPopClientAttrib (void); | ||
1492 | +WINGDIAPI void APIENTRY glPopMatrix (void); | ||
1493 | +WINGDIAPI void APIENTRY glPopName (void); | ||
1494 | +WINGDIAPI void APIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); | ||
1495 | +WINGDIAPI void APIENTRY glPushAttrib (GLbitfield mask); | ||
1496 | +WINGDIAPI void APIENTRY glPushClientAttrib (GLbitfield mask); | ||
1497 | +WINGDIAPI void APIENTRY glPushMatrix (void); | ||
1498 | +WINGDIAPI void APIENTRY glPushName (GLuint name); | ||
1499 | +WINGDIAPI void APIENTRY glRasterPos2d (GLdouble x, GLdouble y); | ||
1500 | +WINGDIAPI void APIENTRY glRasterPos2dv (const GLdouble *v); | ||
1501 | +WINGDIAPI void APIENTRY glRasterPos2f (GLfloat x, GLfloat y); | ||
1502 | +WINGDIAPI void APIENTRY glRasterPos2fv (const GLfloat *v); | ||
1503 | +WINGDIAPI void APIENTRY glRasterPos2i (GLint x, GLint y); | ||
1504 | +WINGDIAPI void APIENTRY glRasterPos2iv (const GLint *v); | ||
1505 | +WINGDIAPI void APIENTRY glRasterPos2s (GLshort x, GLshort y); | ||
1506 | +WINGDIAPI void APIENTRY glRasterPos2sv (const GLshort *v); | ||
1507 | +WINGDIAPI void APIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); | ||
1508 | +WINGDIAPI void APIENTRY glRasterPos3dv (const GLdouble *v); | ||
1509 | +WINGDIAPI void APIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); | ||
1510 | +WINGDIAPI void APIENTRY glRasterPos3fv (const GLfloat *v); | ||
1511 | +WINGDIAPI void APIENTRY glRasterPos3i (GLint x, GLint y, GLint z); | ||
1512 | +WINGDIAPI void APIENTRY glRasterPos3iv (const GLint *v); | ||
1513 | +WINGDIAPI void APIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); | ||
1514 | +WINGDIAPI void APIENTRY glRasterPos3sv (const GLshort *v); | ||
1515 | +WINGDIAPI void APIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); | ||
1516 | +WINGDIAPI void APIENTRY glRasterPos4dv (const GLdouble *v); | ||
1517 | +WINGDIAPI void APIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); | ||
1518 | +WINGDIAPI void APIENTRY glRasterPos4fv (const GLfloat *v); | ||
1519 | +WINGDIAPI void APIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); | ||
1520 | +WINGDIAPI void APIENTRY glRasterPos4iv (const GLint *v); | ||
1521 | +WINGDIAPI void APIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); | ||
1522 | +WINGDIAPI void APIENTRY glRasterPos4sv (const GLshort *v); | ||
1523 | +WINGDIAPI void APIENTRY glReadBuffer (GLenum mode); | ||
1524 | +WINGDIAPI void APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); | ||
1525 | +WINGDIAPI void APIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); | ||
1526 | +WINGDIAPI void APIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); | ||
1527 | +WINGDIAPI void APIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); | ||
1528 | +WINGDIAPI void APIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); | ||
1529 | +WINGDIAPI void APIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); | ||
1530 | +WINGDIAPI void APIENTRY glRectiv (const GLint *v1, const GLint *v2); | ||
1531 | +WINGDIAPI void APIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); | ||
1532 | +WINGDIAPI void APIENTRY glRectsv (const GLshort *v1, const GLshort *v2); | ||
1533 | +WINGDIAPI GLint APIENTRY glRenderMode (GLenum mode); | ||
1534 | +WINGDIAPI void APIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); | ||
1535 | +WINGDIAPI void APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); | ||
1536 | +WINGDIAPI void APIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); | ||
1537 | +WINGDIAPI void APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); | ||
1538 | +WINGDIAPI void APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); | ||
1539 | +WINGDIAPI void APIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); | ||
1540 | +WINGDIAPI void APIENTRY glShadeModel (GLenum mode); | ||
1541 | +WINGDIAPI void APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); | ||
1542 | +WINGDIAPI void APIENTRY glStencilMask (GLuint mask); | ||
1543 | +WINGDIAPI void APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); | ||
1544 | +WINGDIAPI void APIENTRY glTexCoord1d (GLdouble s); | ||
1545 | +WINGDIAPI void APIENTRY glTexCoord1dv (const GLdouble *v); | ||
1546 | +WINGDIAPI void APIENTRY glTexCoord1f (GLfloat s); | ||
1547 | +WINGDIAPI void APIENTRY glTexCoord1fv (const GLfloat *v); | ||
1548 | +WINGDIAPI void APIENTRY glTexCoord1i (GLint s); | ||
1549 | +WINGDIAPI void APIENTRY glTexCoord1iv (const GLint *v); | ||
1550 | +WINGDIAPI void APIENTRY glTexCoord1s (GLshort s); | ||
1551 | +WINGDIAPI void APIENTRY glTexCoord1sv (const GLshort *v); | ||
1552 | +WINGDIAPI void APIENTRY glTexCoord2d (GLdouble s, GLdouble t); | ||
1553 | +WINGDIAPI void APIENTRY glTexCoord2dv (const GLdouble *v); | ||
1554 | +WINGDIAPI void APIENTRY glTexCoord2f (GLfloat s, GLfloat t); | ||
1555 | +WINGDIAPI void APIENTRY glTexCoord2fv (const GLfloat *v); | ||
1556 | +WINGDIAPI void APIENTRY glTexCoord2i (GLint s, GLint t); | ||
1557 | +WINGDIAPI void APIENTRY glTexCoord2iv (const GLint *v); | ||
1558 | +WINGDIAPI void APIENTRY glTexCoord2s (GLshort s, GLshort t); | ||
1559 | +WINGDIAPI void APIENTRY glTexCoord2sv (const GLshort *v); | ||
1560 | +WINGDIAPI void APIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); | ||
1561 | +WINGDIAPI void APIENTRY glTexCoord3dv (const GLdouble *v); | ||
1562 | +WINGDIAPI void APIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); | ||
1563 | +WINGDIAPI void APIENTRY glTexCoord3fv (const GLfloat *v); | ||
1564 | +WINGDIAPI void APIENTRY glTexCoord3i (GLint s, GLint t, GLint r); | ||
1565 | +WINGDIAPI void APIENTRY glTexCoord3iv (const GLint *v); | ||
1566 | +WINGDIAPI void APIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); | ||
1567 | +WINGDIAPI void APIENTRY glTexCoord3sv (const GLshort *v); | ||
1568 | +WINGDIAPI void APIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); | ||
1569 | +WINGDIAPI void APIENTRY glTexCoord4dv (const GLdouble *v); | ||
1570 | +WINGDIAPI void APIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); | ||
1571 | +WINGDIAPI void APIENTRY glTexCoord4fv (const GLfloat *v); | ||
1572 | +WINGDIAPI void APIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); | ||
1573 | +WINGDIAPI void APIENTRY glTexCoord4iv (const GLint *v); | ||
1574 | +WINGDIAPI void APIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); | ||
1575 | +WINGDIAPI void APIENTRY glTexCoord4sv (const GLshort *v); | ||
1576 | +WINGDIAPI void APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); | ||
1577 | +WINGDIAPI void APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); | ||
1578 | +WINGDIAPI void APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); | ||
1579 | +WINGDIAPI void APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); | ||
1580 | +WINGDIAPI void APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); | ||
1581 | +WINGDIAPI void APIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); | ||
1582 | +WINGDIAPI void APIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); | ||
1583 | +WINGDIAPI void APIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); | ||
1584 | +WINGDIAPI void APIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); | ||
1585 | +WINGDIAPI void APIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); | ||
1586 | +WINGDIAPI void APIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); | ||
1587 | +WINGDIAPI void APIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); | ||
1588 | +WINGDIAPI void APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); | ||
1589 | +WINGDIAPI void APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); | ||
1590 | +WINGDIAPI void APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); | ||
1591 | +WINGDIAPI void APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); | ||
1592 | +WINGDIAPI void APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); | ||
1593 | +WINGDIAPI void APIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); | ||
1594 | +WINGDIAPI void APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); | ||
1595 | +WINGDIAPI void APIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); | ||
1596 | +WINGDIAPI void APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); | ||
1597 | +WINGDIAPI void APIENTRY glVertex2d (GLdouble x, GLdouble y); | ||
1598 | +WINGDIAPI void APIENTRY glVertex2dv (const GLdouble *v); | ||
1599 | +WINGDIAPI void APIENTRY glVertex2f (GLfloat x, GLfloat y); | ||
1600 | +WINGDIAPI void APIENTRY glVertex2fv (const GLfloat *v); | ||
1601 | +WINGDIAPI void APIENTRY glVertex2i (GLint x, GLint y); | ||
1602 | +WINGDIAPI void APIENTRY glVertex2iv (const GLint *v); | ||
1603 | +WINGDIAPI void APIENTRY glVertex2s (GLshort x, GLshort y); | ||
1604 | +WINGDIAPI void APIENTRY glVertex2sv (const GLshort *v); | ||
1605 | +WINGDIAPI void APIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); | ||
1606 | +WINGDIAPI void APIENTRY glVertex3dv (const GLdouble *v); | ||
1607 | +WINGDIAPI void APIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); | ||
1608 | +WINGDIAPI void APIENTRY glVertex3fv (const GLfloat *v); | ||
1609 | +WINGDIAPI void APIENTRY glVertex3i (GLint x, GLint y, GLint z); | ||
1610 | +WINGDIAPI void APIENTRY glVertex3iv (const GLint *v); | ||
1611 | +WINGDIAPI void APIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); | ||
1612 | +WINGDIAPI void APIENTRY glVertex3sv (const GLshort *v); | ||
1613 | +WINGDIAPI void APIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); | ||
1614 | +WINGDIAPI void APIENTRY glVertex4dv (const GLdouble *v); | ||
1615 | +WINGDIAPI void APIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); | ||
1616 | +WINGDIAPI void APIENTRY glVertex4fv (const GLfloat *v); | ||
1617 | +WINGDIAPI void APIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); | ||
1618 | +WINGDIAPI void APIENTRY glVertex4iv (const GLint *v); | ||
1619 | +WINGDIAPI void APIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); | ||
1620 | +WINGDIAPI void APIENTRY glVertex4sv (const GLshort *v); | ||
1621 | +WINGDIAPI void APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); | ||
1622 | +WINGDIAPI void APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); | ||
1623 | + | ||
1624 | +#ifdef __DEFINED_GLAPI | ||
1625 | +# undef GLAPI | ||
1626 | +# undef __DEFINED_GLAPI | ||
1627 | +#endif | ||
1628 | + | ||
1629 | +#ifndef GL_GLEXT_LEGACY | ||
1630 | +#include <GL/glext.h> | ||
1631 | +#endif | ||
1632 | + | ||
1633 | +#ifdef __cplusplus | ||
1634 | +} | ||
1635 | +#endif | ||
1636 | + | ||
1637 | +#endif /* __gl_h_ */ |
gl/glext.h
0 → 100644
This diff could not be displayed because it is too large.
gl/glui.h
0 → 100644
1 | +/**************************************************************************** | ||
2 | + | ||
3 | + GLUI User Interface Toolkit | ||
4 | + --------------------------- | ||
5 | + | ||
6 | + glui.h - Main (and only) external header for | ||
7 | + GLUI User Interface Toolkit | ||
8 | + | ||
9 | + -------------------------------------------------- | ||
10 | + | ||
11 | + Copyright (c) 1998 Paul Rademacher | ||
12 | + | ||
13 | + WWW: http://sourceforge.net/projects/glui/ | ||
14 | + Forums: http://sourceforge.net/forum/?group_id=92496 | ||
15 | + | ||
16 | + This software is provided 'as-is', without any express or implied | ||
17 | + warranty. In no event will the authors be held liable for any damages | ||
18 | + arising from the use of this software. | ||
19 | + | ||
20 | + Permission is granted to anyone to use this software for any purpose, | ||
21 | + including commercial applications, and to alter it and redistribute it | ||
22 | + freely, subject to the following restrictions: | ||
23 | + | ||
24 | + 1. The origin of this software must not be misrepresented; you must not | ||
25 | + claim that you wrote the original software. If you use this software | ||
26 | + in a product, an acknowledgment in the product documentation would be | ||
27 | + appreciated but is not required. | ||
28 | + 2. Altered source versions must be plainly marked as such, and must not be | ||
29 | + misrepresented as being the original software. | ||
30 | + 3. This notice may not be removed or altered from any source distribution. | ||
31 | + | ||
32 | +*****************************************************************************/ | ||
33 | + | ||
34 | +#ifndef GLUI_GLUI_H | ||
35 | +#define GLUI_GLUI_H | ||
36 | + | ||
37 | +// Having stdlib here first fixes some 'exit() redefined' errors on MSVC.NET | ||
38 | +// that come from old GLUT headers. | ||
39 | +#include <cstdlib> | ||
40 | +#include <iterator> //added for VS2010 compatability | ||
41 | + | ||
42 | +#if defined(GLUI_FREEGLUT) | ||
43 | + | ||
44 | + // FreeGLUT does not yet work perfectly with GLUI | ||
45 | + // - use at your own risk. | ||
46 | + | ||
47 | + #include <GL/freeglut.h> | ||
48 | + | ||
49 | +#elif defined(GLUI_OPENGLUT) | ||
50 | + | ||
51 | + // OpenGLUT does not yet work properly with GLUI | ||
52 | + // - use at your own risk. | ||
53 | + | ||
54 | + #include <GL/openglut.h> | ||
55 | + | ||
56 | +#else | ||
57 | + | ||
58 | + #ifdef __APPLE__ | ||
59 | + #include <GLUT/glut.h> | ||
60 | + #else | ||
61 | + #include <GL/glut.h> | ||
62 | + #endif | ||
63 | + | ||
64 | +#endif | ||
65 | + | ||
66 | +#include <cstdio> | ||
67 | +#include <cstring> | ||
68 | +#include <string> | ||
69 | +#include <vector> | ||
70 | + | ||
71 | +/* GLUI API shared library export/import declarations. */ | ||
72 | +#if defined(_WIN32) | ||
73 | +# ifdef GLUI_BUILDING_LIB | ||
74 | +# ifdef GLUIDLL | ||
75 | +# define GLUIAPI __declspec(dllexport) | ||
76 | +# else | ||
77 | +# define GLUIAPI | ||
78 | +# endif | ||
79 | +# else | ||
80 | +# ifdef GLUIDLL | ||
81 | +# define GLUIAPI __declspec(dllimport) | ||
82 | +# else | ||
83 | +# define GLUIAPI | ||
84 | +# endif | ||
85 | +# endif | ||
86 | +#else | ||
87 | +#define GLUIAPI | ||
88 | +#endif | ||
89 | + | ||
90 | + | ||
91 | +#define GLUI_VERSION 2.36f /********** Current version **********/ | ||
92 | + | ||
93 | +/* We do it to avoid confusion between x86 and x64 */ | ||
94 | +#define GLUI_NO_LIB_PRAGMA | ||
95 | + | ||
96 | +#if defined(_WIN32) | ||
97 | +# if !defined(GLUI_NO_LIB_PRAGMA) && !defined(GLUI_BUILDING_LIB) | ||
98 | +// Link automatically with GLUI library | ||
99 | +# if defined GLUIDLL // define this when using glui dynamic library | ||
100 | +# pragma comment(lib, "glui32dll.lib") | ||
101 | +# else | ||
102 | +// EG: Removed because for debug builds we want a different lib | ||
103 | +//# pragma comment(lib, "glui32.lib") | ||
104 | +# endif | ||
105 | +# endif | ||
106 | +#endif | ||
107 | + | ||
108 | + | ||
109 | +/********** List of GLUT callbacks ********/ | ||
110 | + | ||
111 | +enum GLUI_Glut_CB_Types | ||
112 | +{ | ||
113 | + GLUI_GLUT_RESHAPE, | ||
114 | + GLUI_GLUT_KEYBOARD, | ||
115 | + GLUI_GLUT_DISPLAY, | ||
116 | + GLUI_GLUT_MOUSE, | ||
117 | + GLUI_GLUT_MOTION, | ||
118 | + GLUI_GLUT_SPECIAL, | ||
119 | + GLUI_GLUT_PASSIVE_MOTION, | ||
120 | + GLUI_GLUT_ENTRY, | ||
121 | + GLUI_GLUT_VISIBILITY | ||
122 | +}; | ||
123 | + | ||
124 | +/********* Constants for window placement **********/ | ||
125 | + | ||
126 | +#define GLUI_XOFF 6 | ||
127 | +#define GLUI_YOFF 6 | ||
128 | +#define GLUI_ITEMSPACING 3 | ||
129 | +#define GLUI_CHECKBOX_SIZE 13 | ||
130 | +#define GLUI_RADIOBUTTON_SIZE 13 | ||
131 | +#define GLUI_BUTTON_SIZE 20 | ||
132 | +#define GLUI_STATICTEXT_SIZE 13 | ||
133 | +#define GLUI_SEPARATOR_HEIGHT 8 | ||
134 | +#define GLUI_DEFAULT_CONTROL_WIDTH 100 | ||
135 | +#define GLUI_DEFAULT_CONTROL_HEIGHT 13 | ||
136 | +#define GLUI_EDITTEXT_BOXINNERMARGINX 3 | ||
137 | +#define GLUI_EDITTEXT_HEIGHT 20 | ||
138 | +#define GLUI_EDITTEXT_WIDTH 130 | ||
139 | +#define GLUI_EDITTEXT_MIN_INT_WIDTH 35 | ||
140 | +#define GLUI_EDITTEXT_MIN_TEXT_WIDTH 50 | ||
141 | +#define GLUI_PANEL_NAME_DROP 8 | ||
142 | +#define GLUI_PANEL_EMBOSS_TOP 4 | ||
143 | +/* #define GLUI_ROTATION_WIDTH 60 */ | ||
144 | +/* #define GLUI_ROTATION_HEIGHT 78 */ | ||
145 | +#define GLUI_ROTATION_WIDTH 50 | ||
146 | +#define GLUI_ROTATION_HEIGHT (GLUI_ROTATION_WIDTH+18) | ||
147 | +#define GLUI_MOUSE_INTERACTION_WIDTH 50 | ||
148 | +#define GLUI_MOUSE_INTERACTION_HEIGHT (GLUI_MOUSE_INTERACTION_WIDTH)+18 | ||
149 | + | ||
150 | +/** Different panel control types **/ | ||
151 | +#define GLUI_PANEL_NONE 0 | ||
152 | +#define GLUI_PANEL_EMBOSSED 1 | ||
153 | +#define GLUI_PANEL_RAISED 2 | ||
154 | + | ||
155 | +/** Max # of els in control's float_array **/ | ||
156 | +#define GLUI_DEF_MAX_ARRAY 30 | ||
157 | + | ||
158 | +/********* The control's 'active' behavior *********/ | ||
159 | +#define GLUI_CONTROL_ACTIVE_MOUSEDOWN 1 | ||
160 | +#define GLUI_CONTROL_ACTIVE_PERMANENT 2 | ||
161 | + | ||
162 | +/********* Control alignment types **********/ | ||
163 | +#define GLUI_ALIGN_CENTER 1 | ||
164 | +#define GLUI_ALIGN_RIGHT 2 | ||
165 | +#define GLUI_ALIGN_LEFT 3 | ||
166 | + | ||
167 | +/********** Limit types - how to limit spinner values *********/ | ||
168 | +#define GLUI_LIMIT_NONE 0 | ||
169 | +#define GLUI_LIMIT_CLAMP 1 | ||
170 | +#define GLUI_LIMIT_WRAP 2 | ||
171 | + | ||
172 | +/********** Translation control types ********************/ | ||
173 | +#define GLUI_TRANSLATION_XY 0 | ||
174 | +#define GLUI_TRANSLATION_Z 1 | ||
175 | +#define GLUI_TRANSLATION_X 2 | ||
176 | +#define GLUI_TRANSLATION_Y 3 | ||
177 | + | ||
178 | +#define GLUI_TRANSLATION_LOCK_NONE 0 | ||
179 | +#define GLUI_TRANSLATION_LOCK_X 1 | ||
180 | +#define GLUI_TRANSLATION_LOCK_Y 2 | ||
181 | + | ||
182 | +/********** How was a control activated? *****************/ | ||
183 | +#define GLUI_ACTIVATE_MOUSE 1 | ||
184 | +#define GLUI_ACTIVATE_TAB 2 | ||
185 | + | ||
186 | +/********** What type of live variable does a control have? **********/ | ||
187 | +#define GLUI_LIVE_NONE 0 | ||
188 | +#define GLUI_LIVE_INT 1 | ||
189 | +#define GLUI_LIVE_FLOAT 2 | ||
190 | +#define GLUI_LIVE_TEXT 3 | ||
191 | +#define GLUI_LIVE_STRING 6 | ||
192 | +#define GLUI_LIVE_DOUBLE 4 | ||
193 | +#define GLUI_LIVE_FLOAT_ARRAY 5 | ||
194 | + | ||
195 | +/************* Textbox and List Defaults - JVK ******************/ | ||
196 | +#define GLUI_TEXTBOX_HEIGHT 130 | ||
197 | +#define GLUI_TEXTBOX_WIDTH 130 | ||
198 | +#define GLUI_LIST_HEIGHT 130 | ||
199 | +#define GLUI_LIST_WIDTH 130 | ||
200 | +#define GLUI_DOUBLE_CLICK 1 | ||
201 | +#define GLUI_SINGLE_CLICK 0 | ||
202 | +#define GLUI_TAB_WIDTH 50 /* In pixels */ | ||
203 | +#define GLUI_TEXTBOX_BOXINNERMARGINX 3 | ||
204 | +#define GLUI_TEXTBOX_MIN_TEXT_WIDTH 50 | ||
205 | +#define GLUI_LIST_BOXINNERMARGINX 3 | ||
206 | +#define GLUI_LIST_MIN_TEXT_WIDTH 50 | ||
207 | + | ||
208 | +/*********************** TreePanel Defaults - JVK *****************************/ | ||
209 | +#define GLUI_TREEPANEL_DEFAULTS 0 // bar, standard bar color | ||
210 | +#define GLUI_TREEPANEL_ALTERNATE_COLOR 1 // Alternate between 8 different bar colors | ||
211 | +#define GLUI_TREEPANEL_ENABLE_BAR 2 // enable the bar | ||
212 | +#define GLUI_TREEPANEL_DISABLE_BAR 4 // disable the bar | ||
213 | +#define GLUI_TREEPANEL_DISABLE_DEEPEST_BAR 8 // disable only the deepest bar | ||
214 | +#define GLUI_TREEPANEL_CONNECT_CHILDREN_ONLY 16 // disable only the bar of the last child of each root | ||
215 | +#define GLUI_TREEPANEL_DISPLAY_HIERARCHY 32 // display some sort of hierachy in the tree node title | ||
216 | +#define GLUI_TREEPANEL_HIERARCHY_NUMERICDOT 64 // display hierarchy in 1.3.2 (etc... ) format | ||
217 | +#define GLUI_TREEPANEL_HIERARCHY_LEVEL_ONLY 128 // display hierarchy as only the level depth | ||
218 | + | ||
219 | +/******************* GLUI Scrollbar Defaults - JVK ***************************/ | ||
220 | +#define GLUI_SCROLL_ARROW_WIDTH 16 | ||
221 | +#define GLUI_SCROLL_ARROW_HEIGHT 16 | ||
222 | +#define GLUI_SCROLL_BOX_MIN_HEIGHT 5 | ||
223 | +#define GLUI_SCROLL_BOX_STD_HEIGHT 16 | ||
224 | +#define GLUI_SCROLL_STATE_NONE 0 | ||
225 | +#define GLUI_SCROLL_STATE_UP 1 | ||
226 | +#define GLUI_SCROLL_STATE_DOWN 2 | ||
227 | +#define GLUI_SCROLL_STATE_BOTH 3 | ||
228 | +#define GLUI_SCROLL_STATE_SCROLL 4 | ||
229 | +#define GLUI_SCROLL_DEFAULT_GROWTH_EXP 1.05f | ||
230 | +#define GLUI_SCROLL_VERTICAL 0 | ||
231 | +#define GLUI_SCROLL_HORIZONTAL 1 | ||
232 | + | ||
233 | + | ||
234 | +/** Size of the character width hash table for faster lookups. | ||
235 | + Make sure to keep this a power of two to avoid the slow divide. | ||
236 | + This is also a speed/memory tradeoff; 128 is enough for low ASCII. | ||
237 | +*/ | ||
238 | +#define CHAR_WIDTH_HASH_SIZE 128 | ||
239 | + | ||
240 | +/********** Translation codes **********/ | ||
241 | + | ||
242 | +enum TranslationCodes | ||
243 | +{ | ||
244 | + GLUI_TRANSLATION_MOUSE_NONE = 0, | ||
245 | + GLUI_TRANSLATION_MOUSE_UP, | ||
246 | + GLUI_TRANSLATION_MOUSE_DOWN, | ||
247 | + GLUI_TRANSLATION_MOUSE_LEFT, | ||
248 | + GLUI_TRANSLATION_MOUSE_RIGHT, | ||
249 | + GLUI_TRANSLATION_MOUSE_UP_LEFT, | ||
250 | + GLUI_TRANSLATION_MOUSE_UP_RIGHT, | ||
251 | + GLUI_TRANSLATION_MOUSE_DOWN_LEFT, | ||
252 | + GLUI_TRANSLATION_MOUSE_DOWN_RIGHT | ||
253 | +}; | ||
254 | + | ||
255 | +/************ A string type for us to use **********/ | ||
256 | + | ||
257 | +typedef std::string GLUI_String; | ||
258 | +GLUIAPI GLUI_String& glui_format_str(GLUI_String &str, const char* fmt, ...); | ||
259 | + | ||
260 | +/********* Pre-declare classes as needed *********/ | ||
261 | + | ||
262 | +class GLUI; | ||
263 | +class GLUI_Control; | ||
264 | +class GLUI_Listbox; | ||
265 | +class GLUI_StaticText; | ||
266 | +class GLUI_EditText; | ||
267 | +class GLUI_Panel; | ||
268 | +class GLUI_Spinner; | ||
269 | +class GLUI_RadioButton; | ||
270 | +class GLUI_RadioGroup; | ||
271 | +class GLUI_Glut_Window; | ||
272 | +class GLUI_TreePanel; | ||
273 | +class GLUI_Scrollbar; | ||
274 | +class GLUI_List; | ||
275 | + | ||
276 | +class Arcball; | ||
277 | + | ||
278 | +/*** Flags for GLUI class constructor ***/ | ||
279 | +#define GLUI_SUBWINDOW ((long)(1<<1)) | ||
280 | +#define GLUI_SUBWINDOW_TOP ((long)(1<<2)) | ||
281 | +#define GLUI_SUBWINDOW_BOTTOM ((long)(1<<3)) | ||
282 | +#define GLUI_SUBWINDOW_LEFT ((long)(1<<4)) | ||
283 | +#define GLUI_SUBWINDOW_RIGHT ((long)(1<<5)) | ||
284 | + | ||
285 | +/*** Codes for different type of edittext boxes and spinners ***/ | ||
286 | +#define GLUI_EDITTEXT_TEXT 1 | ||
287 | +#define GLUI_EDITTEXT_INT 2 | ||
288 | +#define GLUI_EDITTEXT_FLOAT 3 | ||
289 | +#define GLUI_SPINNER_INT GLUI_EDITTEXT_INT | ||
290 | +#define GLUI_SPINNER_FLOAT GLUI_EDITTEXT_FLOAT | ||
291 | +#define GLUI_SCROLL_INT GLUI_EDITTEXT_INT | ||
292 | +#define GLUI_SCROLL_FLOAT GLUI_EDITTEXT_FLOAT | ||
293 | +// This is only for deprecated interface | ||
294 | +#define GLUI_EDITTEXT_STRING 4 | ||
295 | + | ||
296 | +/*** Definition of callbacks ***/ | ||
297 | +typedef void (*GLUI_Update_CB) (int id); | ||
298 | +typedef void (*GLUI_Control_CB)(GLUI_Control *); | ||
299 | +typedef void (*Int1_CB) (int); | ||
300 | +typedef void (*Int2_CB) (int, int); | ||
301 | +typedef void (*Int3_CB) (int, int, int); | ||
302 | +typedef void (*Int4_CB) (int, int, int, int); | ||
303 | + | ||
304 | +/************************************************************/ | ||
305 | +/** | ||
306 | + Callback Adapter Class | ||
307 | + Allows us to support different types of callbacks; | ||
308 | + like a GLUI_Update_CB function pointer--which takes an int; | ||
309 | + and a GLUI_Control_CB function pointer--which takes a GUI_Control object. | ||
310 | +*/ | ||
311 | +class GLUIAPI GLUI_CB | ||
312 | +{ | ||
313 | +public: | ||
314 | + GLUI_CB() : idCB(0),objCB(0) {} | ||
315 | + GLUI_CB(GLUI_Update_CB cb) : idCB(cb),objCB(0) {} | ||
316 | + GLUI_CB(GLUI_Control_CB cb) : idCB(0),objCB(cb) {} | ||
317 | + // (Compiler generated copy constructor) | ||
318 | + | ||
319 | + /** This control just activated. Fire our callback.*/ | ||
320 | + void operator()(GLUI_Control *ctrl) const; | ||
321 | + bool operator!() const { return !idCB && !objCB; } | ||
322 | + operator bool() const { return !(!(*this)); } | ||
323 | +private: | ||
324 | + GLUI_Update_CB idCB; | ||
325 | + GLUI_Control_CB objCB; | ||
326 | +}; | ||
327 | + | ||
328 | +/************************************************************/ | ||
329 | +/* */ | ||
330 | +/* Base class, for hierarchical relationships */ | ||
331 | +/* */ | ||
332 | +/************************************************************/ | ||
333 | + | ||
334 | +class GLUI_Control; | ||
335 | + | ||
336 | +/** | ||
337 | + GLUI_Node is a node in a sort of tree of GLUI controls. | ||
338 | + Each GLUI_Node has a list of siblings (in a circular list) | ||
339 | + and a linked list of children. | ||
340 | + | ||
341 | + Everything onscreen is a GLUI_Node--windows, buttons, etc. | ||
342 | + The nodes are traversed for event processing, sizing, redraws, etc. | ||
343 | +*/ | ||
344 | +class GLUIAPI GLUI_Node | ||
345 | +{ | ||
346 | + friend class GLUI_Tree; /* JVK */ | ||
347 | + friend class GLUI_Rollout; | ||
348 | + friend class GLUI_Main; | ||
349 | + | ||
350 | +public: | ||
351 | + GLUI_Node(); | ||
352 | + virtual ~GLUI_Node() {} | ||
353 | + | ||
354 | + GLUI_Node *first_sibling(); | ||
355 | + GLUI_Node *last_sibling(); | ||
356 | + GLUI_Node *prev(); | ||
357 | + GLUI_Node *next(); | ||
358 | + | ||
359 | + GLUI_Node *first_child() { return child_head; } | ||
360 | + GLUI_Node *last_child() { return child_tail; } | ||
361 | + GLUI_Node *parent() { return parent_node; } | ||
362 | + | ||
363 | + /** Link in a new child control */ | ||
364 | + virtual int add_control( GLUI_Control *control ); | ||
365 | + | ||
366 | + void link_this_to_parent_last (GLUI_Node *parent ); | ||
367 | + void link_this_to_parent_first(GLUI_Node *parent ); | ||
368 | + void link_this_to_sibling_next(GLUI_Node *sibling ); | ||
369 | + void link_this_to_sibling_prev(GLUI_Node *sibling ); | ||
370 | + void unlink(); | ||
371 | + | ||
372 | + void dump( FILE *out, const char *name ); | ||
373 | + | ||
374 | +protected: | ||
375 | + static void add_child_to_control(GLUI_Node *parent,GLUI_Control *child); | ||
376 | + GLUI_Node *parent_node; | ||
377 | + GLUI_Node *child_head; | ||
378 | + GLUI_Node *child_tail; | ||
379 | + GLUI_Node *next_sibling; | ||
380 | + GLUI_Node *prev_sibling; | ||
381 | +}; | ||
382 | + | ||
383 | + | ||
384 | +/************************************************************/ | ||
385 | +/* */ | ||
386 | +/* Standard Bitmap stuff */ | ||
387 | +/* */ | ||
388 | +/************************************************************/ | ||
389 | + | ||
390 | +enum GLUI_StdBitmaps_Codes | ||
391 | +{ | ||
392 | + GLUI_STDBITMAP_CHECKBOX_OFF = 0, | ||
393 | + GLUI_STDBITMAP_CHECKBOX_ON, | ||
394 | + GLUI_STDBITMAP_RADIOBUTTON_OFF, | ||
395 | + GLUI_STDBITMAP_RADIOBUTTON_ON, | ||
396 | + GLUI_STDBITMAP_UP_ARROW, | ||
397 | + GLUI_STDBITMAP_DOWN_ARROW, | ||
398 | + GLUI_STDBITMAP_LEFT_ARROW, | ||
399 | + GLUI_STDBITMAP_RIGHT_ARROW, | ||
400 | + GLUI_STDBITMAP_SPINNER_UP_OFF, | ||
401 | + GLUI_STDBITMAP_SPINNER_UP_ON, | ||
402 | + GLUI_STDBITMAP_SPINNER_DOWN_OFF, | ||
403 | + GLUI_STDBITMAP_SPINNER_DOWN_ON, | ||
404 | + GLUI_STDBITMAP_CHECKBOX_OFF_DIS, /*** Disactivated control bitmaps ***/ | ||
405 | + GLUI_STDBITMAP_CHECKBOX_ON_DIS, | ||
406 | + GLUI_STDBITMAP_RADIOBUTTON_OFF_DIS, | ||
407 | + GLUI_STDBITMAP_RADIOBUTTON_ON_DIS, | ||
408 | + GLUI_STDBITMAP_SPINNER_UP_DIS, | ||
409 | + GLUI_STDBITMAP_SPINNER_DOWN_DIS, | ||
410 | + GLUI_STDBITMAP_LISTBOX_UP, | ||
411 | + GLUI_STDBITMAP_LISTBOX_DOWN, | ||
412 | + GLUI_STDBITMAP_LISTBOX_UP_DIS, | ||
413 | + GLUI_STDBITMAP_NUM_ITEMS | ||
414 | +}; | ||
415 | + | ||
416 | +/************************************************************/ | ||
417 | +/* */ | ||
418 | +/* Class GLUI_Bitmap */ | ||
419 | +/* */ | ||
420 | +/************************************************************/ | ||
421 | + | ||
422 | +/** | ||
423 | + GLUI_Bitmap is a simple 2D texture map. It's used | ||
424 | + to represent small textures like checkboxes, arrows, etc. | ||
425 | + via the GLUI_StdBitmaps class. | ||
426 | +*/ | ||
427 | +class GLUIAPI GLUI_Bitmap | ||
428 | +{ | ||
429 | + friend class GLUI_StdBitmaps; | ||
430 | + | ||
431 | +public: | ||
432 | + GLUI_Bitmap(); | ||
433 | + ~GLUI_Bitmap(); | ||
434 | + | ||
435 | + /** Create bitmap from greyscale byte image */ | ||
436 | + void init_grey(unsigned char *array); | ||
437 | + | ||
438 | + /** Create bitmap from color int image */ | ||
439 | + void init(int *array); | ||
440 | + | ||
441 | +private: | ||
442 | + /** RGB pixel data */ | ||
443 | + unsigned char *pixels; | ||
444 | + int w, h; | ||
445 | +}; | ||
446 | + | ||
447 | + | ||
448 | +/************************************************************/ | ||
449 | +/* */ | ||
450 | +/* Class GLUI_StdBitmap */ | ||
451 | +/* */ | ||
452 | +/************************************************************/ | ||
453 | + | ||
454 | +/** | ||
455 | + Keeps an array of GLUI_Bitmap objects to represent all the | ||
456 | + images used in the UI: checkboxes, arrows, etc. | ||
457 | +*/ | ||
458 | +class GLUIAPI GLUI_StdBitmaps | ||
459 | +{ | ||
460 | +public: | ||
461 | + GLUI_StdBitmaps(); | ||
462 | + ~GLUI_StdBitmaps(); | ||
463 | + | ||
464 | + /** Return the width (in pixels) of the n'th standard bitmap. */ | ||
465 | + int width (int n) const; | ||
466 | + /** Return the height (in pixels) of the n'th standard bitmap. */ | ||
467 | + int height(int n) const; | ||
468 | + | ||
469 | + /** Draw the n'th standard bitmap (one of the enums | ||
470 | + listed in GLUI_StdBitmaps_Codes) at pixel corner (x,y). | ||
471 | + */ | ||
472 | + void draw(int n, int x, int y) const; | ||
473 | + | ||
474 | +private: | ||
475 | + GLUI_Bitmap bitmaps[GLUI_STDBITMAP_NUM_ITEMS]; | ||
476 | +}; | ||
477 | + | ||
478 | +/************************************************************/ | ||
479 | +/* */ | ||
480 | +/* Master GLUI Class */ | ||
481 | +/* */ | ||
482 | +/************************************************************/ | ||
483 | + | ||
484 | +/** | ||
485 | + The master manages our interaction with GLUT. | ||
486 | + There's only one GLUI_Master_Object. | ||
487 | +*/ | ||
488 | +class GLUIAPI GLUI_Master_Object | ||
489 | +{ | ||
490 | + | ||
491 | + friend void glui_idle_func(); | ||
492 | + | ||
493 | +public: | ||
494 | + | ||
495 | + GLUI_Master_Object(); | ||
496 | + ~GLUI_Master_Object(); | ||
497 | + | ||
498 | + GLUI_Node gluis; | ||
499 | + GLUI_Control *active_control, *curr_left_button_glut_menu; | ||
500 | + GLUI *active_control_glui; | ||
501 | + int glui_id_counter; | ||
502 | + | ||
503 | + GLUI_Glut_Window *find_glut_window( int window_id ); | ||
504 | + | ||
505 | + void set_glutIdleFunc(void (*f)(void)); | ||
506 | + | ||
507 | + /************** | ||
508 | + void (*glut_keyboard_CB)(unsigned char, int, int); | ||
509 | + void (*glut_reshape_CB)(int, int); | ||
510 | + void (*glut_special_CB)(int, int, int); | ||
511 | + void (*glut_mouse_CB)(int,int,int,int); | ||
512 | + | ||
513 | + void (*glut_passive_motion_CB)(int,int); | ||
514 | + void (*glut_visibility_CB)(int); | ||
515 | + void (*glut_motion_CB)(int,int); | ||
516 | + void (*glut_display_CB)(void); | ||
517 | + void (*glut_entry_CB)(int); | ||
518 | + **********/ | ||
519 | + | ||
520 | + void set_left_button_glut_menu_control( GLUI_Control *control ); | ||
521 | + | ||
522 | + /********** GLUT callthroughs **********/ | ||
523 | + /* These are the glut callbacks that we do not handle */ | ||
524 | + | ||
525 | + void set_glutReshapeFunc (void (*f)(int width, int height)); | ||
526 | + void set_glutKeyboardFunc(void (*f)(unsigned char key, int x, int y)); | ||
527 | + void set_glutSpecialFunc (void (*f)(int key, int x, int y)); | ||
528 | + void set_glutMouseFunc (void (*f)(int, int, int, int )); | ||
529 | + | ||
530 | + void set_glutDisplayFunc(void (*f)(void)) {glutDisplayFunc(f);} | ||
531 | + void set_glutTimerFunc(unsigned int millis, void (*f)(int value), int value) | ||
532 | + { ::glutTimerFunc(millis,f,value);} | ||
533 | + void set_glutOverlayDisplayFunc(void(*f)(void)){glutOverlayDisplayFunc(f);} | ||
534 | + void set_glutSpaceballMotionFunc(Int3_CB f) {glutSpaceballMotionFunc(f);} | ||
535 | + void set_glutSpaceballRotateFunc(Int3_CB f) {glutSpaceballRotateFunc(f);} | ||
536 | + void set_glutSpaceballButtonFunc(Int2_CB f) {glutSpaceballButtonFunc(f);} | ||
537 | + void set_glutTabletMotionFunc(Int2_CB f) {glutTabletMotionFunc(f);} | ||
538 | + void set_glutTabletButtonFunc(Int4_CB f) {glutTabletButtonFunc(f);} | ||
539 | + /* void set_glutWindowStatusFunc(Int1_CB f) {glutWindowStatusFunc(f);} */ | ||
540 | + void set_glutMenuStatusFunc(Int3_CB f) {glutMenuStatusFunc(f);} | ||
541 | + void set_glutMenuStateFunc(Int1_CB f) {glutMenuStateFunc(f);} | ||
542 | + void set_glutButtonBoxFunc(Int2_CB f) {glutButtonBoxFunc(f);} | ||
543 | + void set_glutDialsFunc(Int2_CB f) {glutDialsFunc(f);} | ||
544 | + | ||
545 | + | ||
546 | + GLUI *create_glui( const char *name, long flags=0, int x=-1, int y=-1 ); | ||
547 | + GLUI *create_glui_subwindow( int parent_window, long flags=0 ); | ||
548 | + GLUI *find_glui_by_window_id( int window_id ); | ||
549 | + void get_viewport_area( int *x, int *y, int *w, int *h ); | ||
550 | + void auto_set_viewport(); | ||
551 | + void close_all(); | ||
552 | + void sync_live_all(); | ||
553 | + | ||
554 | + void reshape(); | ||
555 | + | ||
556 | + float get_version() { return GLUI_VERSION; } | ||
557 | + | ||
558 | + void glui_setIdleFuncIfNecessary(void); | ||
559 | + | ||
560 | +private: | ||
561 | + GLUI_Node glut_windows; | ||
562 | + void (*glut_idle_CB)(void); | ||
563 | + | ||
564 | + void add_cb_to_glut_window(int window,int cb_type,void *cb); | ||
565 | +}; | ||
566 | + | ||
567 | +/** | ||
568 | + This is the only GLUI_Master_Object in existence. | ||
569 | +*/ | ||
570 | +extern GLUIAPI GLUI_Master_Object GLUI_Master; | ||
571 | + | ||
572 | +/************************************************************/ | ||
573 | +/* */ | ||
574 | +/* Class for managing a GLUT window */ | ||
575 | +/* */ | ||
576 | +/************************************************************/ | ||
577 | + | ||
578 | +/** | ||
579 | + A top-level window. The GLUI_Master GLUT callback can route events | ||
580 | + to the callbacks in this class, for arbitrary use by external users. | ||
581 | + (see GLUI_Master_Object::set_glutKeyboardFunc). | ||
582 | + | ||
583 | + This entire approach seems to be superceded by the "subwindow" flavor | ||
584 | + of GLUI. | ||
585 | +*/ | ||
586 | +class GLUIAPI GLUI_Glut_Window : public GLUI_Node | ||
587 | +{ | ||
588 | +public: | ||
589 | + GLUI_Glut_Window(); | ||
590 | + | ||
591 | + int glut_window_id; | ||
592 | + | ||
593 | + /*********** Pointers to GLUT callthrough functions *****/ | ||
594 | + void (*glut_keyboard_CB)(unsigned char, int, int); | ||
595 | + void (*glut_special_CB)(int, int, int); | ||
596 | + void (*glut_reshape_CB)(int, int); | ||
597 | + void (*glut_passive_motion_CB)(int,int); | ||
598 | + void (*glut_mouse_CB)(int,int,int,int); | ||
599 | + void (*glut_visibility_CB)(int); | ||
600 | + void (*glut_motion_CB)(int,int); | ||
601 | + void (*glut_display_CB)(void); | ||
602 | + void (*glut_entry_CB)(int); | ||
603 | +}; | ||
604 | + | ||
605 | +/************************************************************/ | ||
606 | +/* */ | ||
607 | +/* Main Window GLUI class (not user-level) */ | ||
608 | +/* */ | ||
609 | +/************************************************************/ | ||
610 | + | ||
611 | +/** | ||
612 | + A GLUI_Main handles GLUT events for one window, routing them to the | ||
613 | + appropriate controls. The central user-visible "GLUI" class | ||
614 | + inherits from this class; users should not allocate GLUT_Main objects. | ||
615 | + | ||
616 | + There's a separate GLUI_Main object for: | ||
617 | + - Each top-level window with GUI stuff in it. | ||
618 | + - Each "subwindow" of another top-level window. | ||
619 | + | ||
620 | + All the GLUI_Main objects are listed in GLUI_Master.gluis. | ||
621 | + A better name for this class might be "GLUI_Environment"; | ||
622 | + this class provides the window-level context for every control. | ||
623 | +*/ | ||
624 | +class GLUIAPI GLUI_Main : public GLUI_Node | ||
625 | +{ | ||
626 | + /********** Friend classes *************/ | ||
627 | + | ||
628 | + friend class GLUI_Control; | ||
629 | + friend class GLUI_Rotation; | ||
630 | + friend class GLUI_Translation; | ||
631 | + friend class GLUI; | ||
632 | + friend class GLUI_Master_Object; | ||
633 | + | ||
634 | + /*********** Friend functions **********/ | ||
635 | + | ||
636 | + friend void glui_mouse_func(int button, int state, int x, int y); | ||
637 | + friend void glui_keyboard_func(unsigned char key, int x, int y); | ||
638 | + friend void glui_special_func(int key, int x, int y); | ||
639 | + friend void glui_passive_motion_func(int x, int y); | ||
640 | + friend void glui_reshape_func( int w, int h ); | ||
641 | + friend void glui_visibility_func(int state); | ||
642 | + friend void glui_motion_func(int x, int y); | ||
643 | + friend void glui_entry_func(int state); | ||
644 | + friend void glui_display_func( void ); | ||
645 | + friend void glui_idle_func(void); | ||
646 | + | ||
647 | + friend void glui_parent_window_reshape_func( int w, int h ); | ||
648 | + friend void glui_parent_window_keyboard_func( unsigned char, int, int ); | ||
649 | + friend void glui_parent_window_special_func( int, int, int ); | ||
650 | + friend void glui_parent_window_mouse_func( int, int, int, int ); | ||
651 | + | ||
652 | +protected: | ||
653 | + /*** Variables ***/ | ||
654 | + int main_gfx_window_id; | ||
655 | + int mouse_button_down; | ||
656 | + int glut_window_id; | ||
657 | + int top_level_glut_window_id; | ||
658 | + GLUI_Control *active_control; | ||
659 | + GLUI_Control *mouse_over_control; | ||
660 | + GLUI_Panel *main_panel; | ||
661 | + enum buffer_mode_t { | ||
662 | + buffer_front=1, ///< Draw updated controls directly to screen. | ||
663 | + buffer_back=2 ///< Double buffering: postpone updates until next redraw. | ||
664 | + }; | ||
665 | + buffer_mode_t buffer_mode; ///< Current drawing mode | ||
666 | + int curr_cursor; | ||
667 | + int w, h; | ||
668 | + long flags; | ||
669 | + bool closing; | ||
670 | + int parent_window; | ||
671 | + int glui_id; | ||
672 | + | ||
673 | + /********** Misc functions *************/ | ||
674 | + | ||
675 | + GLUI_Control *find_control( int x, int y ); | ||
676 | + GLUI_Control *find_next_control( GLUI_Control *control ); | ||
677 | + GLUI_Control *find_next_control_rec( GLUI_Control *control ); | ||
678 | + GLUI_Control *find_next_control_( GLUI_Control *control ); | ||
679 | + GLUI_Control *find_prev_control( GLUI_Control *control ); | ||
680 | + void create_standalone_window( const char *name, int x=-1, int y=-1 ); | ||
681 | + void create_subwindow( int parent,int window_alignment ); | ||
682 | + void setup_default_glut_callbacks( void ); | ||
683 | + | ||
684 | + void mouse(int button, int state, int x, int y); | ||
685 | + void keyboard(unsigned char key, int x, int y); | ||
686 | + void special(int key, int x, int y); | ||
687 | + void passive_motion(int x, int y); | ||
688 | + void reshape( int w, int h ); | ||
689 | + void visibility(int state); | ||
690 | + void motion(int x, int y); | ||
691 | + void entry(int state); | ||
692 | + void display( void ); | ||
693 | + void idle(void); | ||
694 | + int needs_idle(void); | ||
695 | + | ||
696 | + void (*glut_mouse_CB)(int, int, int, int); | ||
697 | + void (*glut_keyboard_CB)(unsigned char, int, int); | ||
698 | + void (*glut_special_CB)(int, int, int); | ||
699 | + void (*glut_reshape_CB)(int, int); | ||
700 | + | ||
701 | + | ||
702 | + /*********** Controls ************/ | ||
703 | + | ||
704 | + virtual int add_control( GLUI_Node *parent, GLUI_Control *control ); | ||
705 | + | ||
706 | + | ||
707 | + /********** Constructors and Destructors ***********/ | ||
708 | + | ||
709 | + GLUI_Main( void ); | ||
710 | + | ||
711 | +public: | ||
712 | + GLUI_StdBitmaps std_bitmaps; | ||
713 | + GLUI_String window_name; | ||
714 | + unsigned char bkgd_color[3]; | ||
715 | + float bkgd_color_f[3]; | ||
716 | + | ||
717 | + void *font; | ||
718 | + int curr_modifiers; | ||
719 | + | ||
720 | + void adjust_glut_xy( int &/*x*/, int &y ) { y = h-y; } | ||
721 | + void activate_control( GLUI_Control *control, int how ); | ||
722 | + void align_controls( GLUI_Control *control ); | ||
723 | + void deactivate_current_control( void ); | ||
724 | + | ||
725 | + /** Draw a 3D-look pushed-out box around this rectangle */ | ||
726 | + void draw_raised_box( int x, int y, int w, int h ); | ||
727 | + /** Draw a 3D-look pushed-in box around this rectangle */ | ||
728 | + void draw_lowered_box( int x, int y, int w, int h ); | ||
729 | + | ||
730 | + /** Return true if this control should redraw itself immediately (front buffer); | ||
731 | + Or queue up a redraw and return false if it shouldn't (back buffer). | ||
732 | + */ | ||
733 | + bool should_redraw_now(GLUI_Control *ctl); | ||
734 | + | ||
735 | + /** Switch to the appropriate draw buffer now. Returns the old draw buffer. | ||
736 | + This routine should probably only be called from inside the GLUI_DrawingSentinal, | ||
737 | + in glui_internal_control.h | ||
738 | + */ | ||
739 | + int set_current_draw_buffer(); | ||
740 | + /** Go back to using this draw buffer. Undoes set_current_draw_buffer. */ | ||
741 | + void restore_draw_buffer( int buffer_state ); | ||
742 | + | ||
743 | + /** Pack, resize the window, and redraw all the controls. */ | ||
744 | + void refresh(); | ||
745 | + | ||
746 | + /** Redraw the main graphics window */ | ||
747 | + void post_update_main_gfx(); | ||
748 | + | ||
749 | + /** Recompute the sizes and positions of all controls */ | ||
750 | + void pack_controls(); | ||
751 | + | ||
752 | + void close_internal(); | ||
753 | + void check_subwindow_position(); | ||
754 | + void set_ortho_projection(); | ||
755 | + void set_viewport(); | ||
756 | + int get_glut_window_id( void ) { return glut_window_id; } /* JVK */ | ||
757 | +}; | ||
758 | + | ||
759 | +/************************************************************/ | ||
760 | +/* */ | ||
761 | +/* GLUI_Control: base class for all controls */ | ||
762 | +/* */ | ||
763 | +/************************************************************/ | ||
764 | + | ||
765 | +/** | ||
766 | + All the GUI objects inherit from GLUI_Control: buttons, | ||
767 | + checkboxes, labels, edit boxes, scrollbars, etc. | ||
768 | + Most of the work of this class is in routing events, | ||
769 | + like keystrokes, mouseclicks, redraws, and sizing events. | ||
770 | + | ||
771 | + Yes, this is a huge and hideous class. It needs to be | ||
772 | + split up into simpler subobjects. None of the data members | ||
773 | + should be directly accessed by users (they should be protected, | ||
774 | + not public); only subclasses. | ||
775 | +*/ | ||
776 | +class GLUIAPI GLUI_Control : public GLUI_Node | ||
777 | +{ | ||
778 | +public: | ||
779 | + | ||
780 | +/** Onscreen coordinates */ | ||
781 | + int w, h; /* dimensions of control */ | ||
782 | + int x_abs, y_abs; | ||
783 | + int x_off, y_off_top, y_off_bot; /* INNER margins, by which child | ||
784 | + controls are indented */ | ||
785 | + int contain_x, contain_y; | ||
786 | + int contain_w, contain_h; | ||
787 | + /* if this is a container control (e.g., | ||
788 | + radiogroup or panel) this indicated dimensions | ||
789 | + of inner area in which controls reside */ | ||
790 | + | ||
791 | +/** "activation" for tabbing between controls. */ | ||
792 | + int active_type; ///< "GLUI_CONTROL_ACTIVE_..." | ||
793 | + bool active; ///< If true, we've got the focus | ||
794 | + bool can_activate; ///< If false, remove from tab order. | ||
795 | + bool spacebar_mouse_click; ///< Spacebar simulates click. | ||
796 | + | ||
797 | +/** Callbacks */ | ||
798 | + long user_id; ///< Integer to pass to callback function. | ||
799 | + GLUI_CB callback; ///< User callback function, or NULL. | ||
800 | + | ||
801 | +/** Variable value storage */ | ||
802 | + float float_val; /**< Our float value */ | ||
803 | + int int_val; /**< Our integer value */ | ||
804 | + float float_array_val[GLUI_DEF_MAX_ARRAY]; | ||
805 | + int float_array_size; | ||
806 | + GLUI_String text; /**< The text inside this control */ | ||
807 | + | ||
808 | +/** "Live variable" updating */ | ||
809 | + void *ptr_val; /**< A pointer to the user's live variable value */ | ||
810 | + int live_type; | ||
811 | + bool live_inited; | ||
812 | + /* These variables store the last value that live variable was known to have. */ | ||
813 | + int last_live_int; | ||
814 | + float last_live_float; | ||
815 | + GLUI_String last_live_text; | ||
816 | + float last_live_float_array[GLUI_DEF_MAX_ARRAY]; | ||
817 | + | ||
818 | +/** Properties of our control */ | ||
819 | + GLUI *glui; /**< Our containing event handler (NEVER NULL during event processing!) */ | ||
820 | + bool is_container; /**< Is this a container class (e.g., panel) */ | ||
821 | + int alignment; | ||
822 | + bool enabled; /**< Is this control grayed out? */ | ||
823 | + GLUI_String name; /**< The name of this control */ | ||
824 | + void *font; /**< Our glutbitmap font */ | ||
825 | + bool collapsible, is_open; | ||
826 | + GLUI_Node collapsed_node; | ||
827 | + bool hidden; /* Collapsed controls (and children) are hidden */ | ||
828 | + int char_widths[CHAR_WIDTH_HASH_SIZE][2]; /* Character width hash table */ | ||
829 | + | ||
830 | +public: | ||
831 | + /*** Get/Set values ***/ | ||
832 | + virtual void set_name( const char *string ); | ||
833 | + virtual void set_int_val( int new_int ) { int_val = new_int; output_live(true); } | ||
834 | + virtual void set_float_val( float new_float ) { float_val = new_float; output_live(true); } | ||
835 | + virtual void set_ptr_val( void *new_ptr ) { ptr_val = new_ptr; output_live(true); } | ||
836 | + virtual void set_float_array_val( float *array_ptr ); | ||
837 | + | ||
838 | + virtual float get_float_val( void ) { return float_val; } | ||
839 | + virtual int get_int_val( void ) { return int_val; } | ||
840 | + virtual void get_float_array_val( float *array_ptr ); | ||
841 | + virtual int get_id( void ) const { return user_id; } | ||
842 | + virtual void set_id( int id ) { user_id=id; } | ||
843 | + | ||
844 | + virtual int mouse_down_handler( int /*local_x*/, int /*local_y*/ ) { return false; } | ||
845 | + virtual int mouse_up_handler( int /*local_x*/, int /*local_y*/, bool /*inside*/ ) { return false; } | ||
846 | + virtual int mouse_held_down_handler( int /*local_x*/, int /*local_y*/, bool /*inside*/) { return false; } | ||
847 | + virtual int key_handler( unsigned char /*key*/, int /*modifiers*/ ) { return false; } | ||
848 | + virtual int special_handler( int /*key*/,int /*modifiers*/ ) { return false; } | ||
849 | + | ||
850 | + virtual void update_size( void ) { } | ||
851 | + virtual void idle( void ) { } | ||
852 | + virtual int mouse_over( int /*state*/, int /*x*/, int /*y*/ ) { return false; } | ||
853 | + | ||
854 | + virtual void enable( void ); | ||
855 | + virtual void disable( void ); | ||
856 | + virtual void activate( int /*how*/ ) { active = true; } | ||
857 | + virtual void deactivate( void ) { active = false; } | ||
858 | + | ||
859 | + /** Hide (shrink into a rollout) and unhide (expose from a rollout) */ | ||
860 | + void hide_internal( int recurse ); | ||
861 | + void unhide_internal( int recurse ); | ||
862 | + | ||
863 | + /** Return true if it currently makes sense to draw this class. */ | ||
864 | + int can_draw( void ) { return (glui != NULL && hidden == false); } | ||
865 | + | ||
866 | + /** Redraw this control. | ||
867 | + In single-buffering mode (drawing to GL_FRONT), this is just | ||
868 | + a call to translate_and_draw_front (after a can_draw() check). | ||
869 | + In double-buffering mode (drawing to GL_BACK), this queues up | ||
870 | + a redraw and returns false, since you shouldn't draw yet. | ||
871 | + */ | ||
872 | + void redraw(void); | ||
873 | + | ||
874 | + /** Redraw everybody in our window. */ | ||
875 | + void redraw_window(void); | ||
876 | + | ||
877 | + virtual void align( void ); | ||
878 | + void pack( int x, int y ); /* Recalculate positions and offsets */ | ||
879 | + void pack_old( int x, int y ); | ||
880 | + void draw_recursive( int x, int y ); | ||
881 | + int set_to_glut_window( void ); | ||
882 | + void restore_window( int orig ); | ||
883 | + void translate_and_draw_front( void ); | ||
884 | + void translate_to_origin( void ) | ||
885 | + {glTranslatef((float)x_abs+.5f,(float)y_abs+.5f,0.0f);} | ||
886 | + virtual void draw( int x, int y )=0; | ||
887 | + void set_font( void *new_font ); | ||
888 | + void *get_font( void ); | ||
889 | + int string_width( const char *text ); | ||
890 | + int string_width( const GLUI_String &str ) | ||
891 | + { return string_width(str.c_str()); } | ||
892 | + int char_width( char c ); | ||
893 | + | ||
894 | + void draw_name( int x, int y ); | ||
895 | + void draw_box_inwards_outline( int x_min, int x_max, | ||
896 | + int y_min, int y_max ); | ||
897 | + void draw_box( int x_min, int x_max, int y_min, int y_max, | ||
898 | + float r, float g, float b ); | ||
899 | + void draw_bkgd_box( int x_min, int x_max, int y_min, int y_max ); | ||
900 | + void draw_emboss_box( int x_min, int x_max,int y_min,int y_max); | ||
901 | + void draw_string( const char *text ); | ||
902 | + void draw_string( const GLUI_String &s ) | ||
903 | + { draw_string(s.c_str()); } | ||
904 | + void draw_char( char c ); | ||
905 | + void draw_active_box( int x_min, int x_max, int y_min, int y_max ); | ||
906 | + void set_to_bkgd_color( void ); | ||
907 | + | ||
908 | + void set_w( int new_w ); | ||
909 | + void set_h( int new_w ); | ||
910 | + void set_alignment( int new_align ); | ||
911 | + void sync_live( int recurse, int draw ); /* Reads live variable */ | ||
912 | + void init_live( void ); | ||
913 | + void output_live( int update_main_gfx ); /** Writes live variable **/ | ||
914 | + virtual void set_text( const char * /*t*/ ) {} | ||
915 | + void execute_callback( void ); | ||
916 | + void get_this_column_dims( int *col_x, int *col_y, | ||
917 | + int *col_w, int *col_h, | ||
918 | + int *col_x_off, int *col_y_off ); | ||
919 | + virtual bool needs_idle( void ) const; | ||
920 | + virtual bool wants_tabs() const { return false; } | ||
921 | + | ||
922 | + GLUI_Control(void) | ||
923 | + { | ||
924 | + x_off = GLUI_XOFF; | ||
925 | + y_off_top = GLUI_YOFF; | ||
926 | + y_off_bot = GLUI_YOFF; | ||
927 | + x_abs = GLUI_XOFF; | ||
928 | + y_abs = GLUI_YOFF; | ||
929 | + active = false; | ||
930 | + enabled = true; | ||
931 | + int_val = 0; | ||
932 | + last_live_int = 0; | ||
933 | + float_array_size = 0; | ||
934 | + glui_format_str(name, "Control: %p", this); | ||
935 | + float_val = 0.0; | ||
936 | + last_live_float = 0.0; | ||
937 | + ptr_val = NULL; | ||
938 | + glui = NULL; | ||
939 | + w = GLUI_DEFAULT_CONTROL_WIDTH; | ||
940 | + h = GLUI_DEFAULT_CONTROL_HEIGHT; | ||
941 | + font = NULL; | ||
942 | + active_type = GLUI_CONTROL_ACTIVE_MOUSEDOWN; | ||
943 | + alignment = GLUI_ALIGN_LEFT; | ||
944 | + is_container = false; | ||
945 | + can_activate = true; /* By default, you can activate a control */ | ||
946 | + spacebar_mouse_click = true; /* Does spacebar simulate a mouse click? */ | ||
947 | + live_type = GLUI_LIVE_NONE; | ||
948 | + text = ""; | ||
949 | + last_live_text == ""; | ||
950 | + live_inited = false; | ||
951 | + collapsible = false; | ||
952 | + is_open = true; | ||
953 | + hidden = false; | ||
954 | + memset(char_widths, -1, sizeof(char_widths)); /* JVK */ | ||
955 | + int i; | ||
956 | + for( i=0; i<GLUI_DEF_MAX_ARRAY; i++ ) | ||
957 | + float_array_val[i] = last_live_float_array[i] = 0.0; | ||
958 | + } | ||
959 | + | ||
960 | + virtual ~GLUI_Control(); | ||
961 | +}; | ||
962 | + | ||
963 | +/************************************************************/ | ||
964 | +/* */ | ||
965 | +/* Button class (container) */ | ||
966 | +/* */ | ||
967 | +/************************************************************/ | ||
968 | +/** | ||
969 | + An onscreen, clickable button--an outlined label that | ||
970 | + can be clicked. When clicked, a button | ||
971 | + calls its GLUI_CB callback with its ID. | ||
972 | +*/ | ||
973 | +class GLUIAPI GLUI_Button : public GLUI_Control | ||
974 | +{ | ||
975 | +public: | ||
976 | + bool currently_inside; | ||
977 | + | ||
978 | + int mouse_down_handler( int local_x, int local_y ); | ||
979 | + int mouse_up_handler( int local_x, int local_y, bool inside ); | ||
980 | + int mouse_held_down_handler( int local_x, int local_y, bool inside ); | ||
981 | + int key_handler( unsigned char key,int modifiers ); | ||
982 | + | ||
983 | + void draw( int x, int y ); | ||
984 | + void draw_pressed( void ); | ||
985 | + void draw_text( int sunken ); | ||
986 | + | ||
987 | + void update_size( void ); | ||
988 | + | ||
989 | +/** | ||
990 | + Create a new button. | ||
991 | + | ||
992 | + @param parent The panel our object is inside; or the main GLUI object. | ||
993 | + @param name The text inside the button. | ||
994 | + @param id Optional ID number, to pass to the optional callback function. | ||
995 | + @param callback Optional callback function, taking either the int ID or control. | ||
996 | +*/ | ||
997 | + GLUI_Button( GLUI_Node *parent, const char *name, | ||
998 | + int id=-1, GLUI_CB cb=GLUI_CB() ); | ||
999 | + GLUI_Button( void ) { common_init(); }; | ||
1000 | + | ||
1001 | +protected: | ||
1002 | + void common_init(void) { | ||
1003 | + glui_format_str(name, "Button: %p", this ); | ||
1004 | + h = GLUI_BUTTON_SIZE; | ||
1005 | + w = 100; | ||
1006 | + alignment = GLUI_ALIGN_CENTER; | ||
1007 | + can_activate = true; | ||
1008 | + } | ||
1009 | +}; | ||
1010 | + | ||
1011 | + | ||
1012 | +/************************************************************/ | ||
1013 | +/* */ | ||
1014 | +/* Checkbox class (container) */ | ||
1015 | +/* */ | ||
1016 | +/************************************************************/ | ||
1017 | + | ||
1018 | +/** | ||
1019 | + A checkbox, which can be checked on or off. Can be linked | ||
1020 | + to an int value, which gets 1 for on and 0 for off. | ||
1021 | +*/ | ||
1022 | +class GLUIAPI GLUI_Checkbox : public GLUI_Control | ||
1023 | +{ | ||
1024 | +public: | ||
1025 | + int orig_value; | ||
1026 | + bool currently_inside; | ||
1027 | + int text_x_offset; | ||
1028 | + | ||
1029 | + int mouse_down_handler( int local_x, int local_y ); | ||
1030 | + int mouse_up_handler( int local_x, int local_y, bool inside ); | ||
1031 | + int mouse_held_down_handler( int local_x, int local_y, bool inside ); | ||
1032 | + int key_handler( unsigned char key,int modifiers ); | ||
1033 | + | ||
1034 | + void update_size( void ); | ||
1035 | + | ||
1036 | + void draw( int x, int y ); | ||
1037 | + | ||
1038 | + void draw_active_area( void ); | ||
1039 | + void draw_empty_box( void ); | ||
1040 | + void set_int_val( int new_val ); | ||
1041 | + | ||
1042 | +/** | ||
1043 | + Create a new checkbox object. | ||
1044 | + | ||
1045 | + @param parent The panel our object is inside; or the main GLUI object. | ||
1046 | + @param name Label next to our checkbox. | ||
1047 | + @param value_ptr Optional integer value to attach to this checkbox. When the | ||
1048 | + checkbox is checked or unchecked, *value_ptr will also be changed. ("Live Vars"). | ||
1049 | + @param id Optional ID number, to pass to the optional callback function. | ||
1050 | + @param callback Optional callback function, taking either the int ID or control. | ||
1051 | +*/ | ||
1052 | + GLUI_Checkbox(GLUI_Node *parent, const char *name, int *value_ptr=NULL, | ||
1053 | + int id=-1, GLUI_CB callback=GLUI_CB()); | ||
1054 | + GLUI_Checkbox( void ) { common_init(); } | ||
1055 | + | ||
1056 | +protected: | ||
1057 | + void common_init(void) { | ||
1058 | + glui_format_str( name, "Checkbox: %p", this ); | ||
1059 | + w = 100; | ||
1060 | + h = GLUI_CHECKBOX_SIZE; | ||
1061 | + orig_value = -1; | ||
1062 | + text_x_offset = 18; | ||
1063 | + can_activate = true; | ||
1064 | + live_type = GLUI_LIVE_INT; /* This control has an 'int' live var */ | ||
1065 | + } | ||
1066 | +}; | ||
1067 | + | ||
1068 | +/************************************************************/ | ||
1069 | +/* */ | ||
1070 | +/* Column class */ | ||
1071 | +/* */ | ||
1072 | +/************************************************************/ | ||
1073 | + | ||
1074 | +/** | ||
1075 | + A GLUI_Column object separates all previous controls | ||
1076 | + from subsequent controls with a vertical bar. | ||
1077 | +*/ | ||
1078 | +class GLUIAPI GLUI_Column : public GLUI_Control | ||
1079 | +{ | ||
1080 | +public: | ||
1081 | + void draw( int x, int y ); | ||
1082 | + | ||
1083 | +/** | ||
1084 | + Create a new column, which separates the previous controls | ||
1085 | + from subsequent controls. | ||
1086 | + | ||
1087 | + @param parent The panel our object is inside; or the main GLUI object. | ||
1088 | + @param draw_bar If true, draw a visible bar between new and old controls. | ||
1089 | +*/ | ||
1090 | + GLUI_Column( GLUI_Node *parent, int draw_bar = true ); | ||
1091 | + GLUI_Column( void ) { common_init(); } | ||
1092 | + | ||
1093 | +protected: | ||
1094 | + void common_init() { | ||
1095 | + w = 0; | ||
1096 | + h = 0; | ||
1097 | + int_val = 0; | ||
1098 | + can_activate = false; | ||
1099 | + } | ||
1100 | +}; | ||
1101 | + | ||
1102 | + | ||
1103 | +/************************************************************/ | ||
1104 | +/* */ | ||
1105 | +/* Panel class (container) */ | ||
1106 | +/* */ | ||
1107 | +/************************************************************/ | ||
1108 | + | ||
1109 | +/** | ||
1110 | + A GLUI_Panel contains a group of related controls. | ||
1111 | +*/ | ||
1112 | +class GLUIAPI GLUI_Panel : public GLUI_Control | ||
1113 | +{ | ||
1114 | +public: | ||
1115 | + | ||
1116 | +/** | ||
1117 | + Create a new panel. A panel groups together a set of related controls. | ||
1118 | + | ||
1119 | + @param parent The outer panel our panel is inside; or the main GLUI object. | ||
1120 | + @param name The string name at the top of our panel. | ||
1121 | + @param type Optional style to display the panel with--GLUI_PANEL_EMBOSSED by default. | ||
1122 | + GLUI_PANEL_RAISED causes the panel to appear higher than the surroundings. | ||
1123 | + GLUI_PANEL_NONE causes the panel's outline to be invisible. | ||
1124 | +*/ | ||
1125 | + GLUI_Panel( GLUI_Node *parent, const char *name, | ||
1126 | + int type=GLUI_PANEL_EMBOSSED ); | ||
1127 | + GLUI_Panel() { common_init(); } | ||
1128 | + | ||
1129 | + void draw( int x, int y ); | ||
1130 | + void set_name( const char *text ); | ||
1131 | + void set_type( int new_type ); | ||
1132 | + | ||
1133 | + void update_size( void ); | ||
1134 | + | ||
1135 | +protected: | ||
1136 | + void common_init( void ) { | ||
1137 | + w = 300; | ||
1138 | + h = GLUI_DEFAULT_CONTROL_HEIGHT + 7; | ||
1139 | + int_val = GLUI_PANEL_EMBOSSED; | ||
1140 | + alignment = GLUI_ALIGN_CENTER; | ||
1141 | + is_container = true; | ||
1142 | + can_activate = false; | ||
1143 | + name=""; | ||
1144 | + }; | ||
1145 | +}; | ||
1146 | + | ||
1147 | +/************************************************************/ | ||
1148 | +/* */ | ||
1149 | +/* File Browser class (container) */ | ||
1150 | +/* JVK */ | ||
1151 | +/************************************************************/ | ||
1152 | + | ||
1153 | +/** | ||
1154 | + A list of files the user can select from. | ||
1155 | +*/ | ||
1156 | +class GLUIAPI GLUI_FileBrowser : public GLUI_Panel | ||
1157 | +{ | ||
1158 | +public: | ||
1159 | +/** | ||
1160 | + Create a new list of files the user can select from. | ||
1161 | + | ||
1162 | + @param parent The panel our object is inside; or the main GLUI object. | ||
1163 | + @param name Prompt to give to the user at the top of the file browser. | ||
1164 | + @param frame_type Optional style to display the panel with--GLUI_PANEL_EMBOSSED by default. | ||
1165 | + GLUI_PANEL_RAISED causes the panel to appear higher than the surroundings. | ||
1166 | + GLUI_PANEL_NONE causes the panel's outline to be invisible. | ||
1167 | + @param id Optional ID number, to pass to the optional callback function. | ||
1168 | + @param callback Optional callback function, taking either the int ID or control. | ||
1169 | +*/ | ||
1170 | + GLUI_FileBrowser( GLUI_Node *parent, | ||
1171 | + const char *name, | ||
1172 | + int frame_type = GLUI_PANEL_EMBOSSED, | ||
1173 | + int user_id = -1, | ||
1174 | + GLUI_CB callback = GLUI_CB()); | ||
1175 | + | ||
1176 | + GLUI_List *list; | ||
1177 | + GLUI_String current_dir; | ||
1178 | + | ||
1179 | + void fbreaddir(const char *); | ||
1180 | + static void dir_list_callback(GLUI_Control*); | ||
1181 | + | ||
1182 | + void set_w(int w); | ||
1183 | + void set_h(int h); | ||
1184 | + const char* get_file() { return file.c_str(); } | ||
1185 | + void set_allow_change_dir(int c) { allow_change_dir = c; } | ||
1186 | + | ||
1187 | +protected: | ||
1188 | + void common_init() | ||
1189 | + { | ||
1190 | + w = GLUI_DEFAULT_CONTROL_WIDTH; | ||
1191 | + h = GLUI_DEFAULT_CONTROL_HEIGHT; | ||
1192 | + int_val = GLUI_PANEL_EMBOSSED; | ||
1193 | + alignment = GLUI_ALIGN_CENTER; | ||
1194 | + is_container = true; | ||
1195 | + can_activate = false; | ||
1196 | + allow_change_dir = true; | ||
1197 | + last_item = -1; | ||
1198 | + user_id = -1; | ||
1199 | + name = ""; | ||
1200 | + current_dir = "."; | ||
1201 | + file = ""; | ||
1202 | + }; | ||
1203 | + | ||
1204 | +private: | ||
1205 | + int last_item; | ||
1206 | + GLUI_String file; | ||
1207 | + int allow_change_dir; | ||
1208 | + | ||
1209 | +}; | ||
1210 | + | ||
1211 | +/************************************************************/ | ||
1212 | +/* */ | ||
1213 | +/* Rollout class (container) */ | ||
1214 | +/* */ | ||
1215 | +/************************************************************/ | ||
1216 | +/** | ||
1217 | + A rollout contains a set of controls, | ||
1218 | + like a panel, but can be collapsed to just the name. | ||
1219 | +*/ | ||
1220 | +class GLUIAPI GLUI_Rollout : public GLUI_Panel | ||
1221 | +{ | ||
1222 | +public: | ||
1223 | + | ||
1224 | +/** | ||
1225 | + Create a new rollout. A rollout contains a set of controls, | ||
1226 | + like a panel, but can be collapsed to just the name. | ||
1227 | + | ||
1228 | + @param parent The panel our object is inside; or the main GLUI object. | ||
1229 | + @param name String to show at the top of the rollout. | ||
1230 | + @param open Optional boolean. If true (the default), the rollout's controls are displayed. | ||
1231 | + If false, the rollout is closed to display only the name. | ||
1232 | + @param type Optional style to display the panel with--GLUI_PANEL_EMBOSSED by default. | ||
1233 | + GLUI_PANEL_RAISED causes the panel to appear higher than the surroundings. | ||
1234 | + GLUI_PANEL_NONE causes the panel's outline to be invisible. | ||
1235 | +*/ | ||
1236 | + GLUI_Rollout( GLUI_Node *parent, const char *name, int open=true, | ||
1237 | + int type=GLUI_PANEL_EMBOSSED ); | ||
1238 | + GLUI_Rollout( void ) { common_init(); } | ||
1239 | + | ||
1240 | + | ||
1241 | + bool currently_inside, initially_inside; | ||
1242 | + GLUI_Button button; | ||
1243 | + | ||
1244 | + void draw( int x, int y ); | ||
1245 | + void draw_pressed( void ); | ||
1246 | + int mouse_down_handler( int local_x, int local_y ); | ||
1247 | + int mouse_up_handler( int local_x, int local_y, bool inside ); | ||
1248 | + int mouse_held_down_handler( int local_x, int local_y, bool inside ); | ||
1249 | + | ||
1250 | + void open( void ); | ||
1251 | + void close( void ); | ||
1252 | + | ||
1253 | + void update_size( void ); | ||
1254 | + | ||
1255 | +protected: | ||
1256 | + void common_init() { | ||
1257 | + currently_inside = false; | ||
1258 | + initially_inside = false; | ||
1259 | + can_activate = true; | ||
1260 | + is_container = true; | ||
1261 | + h = GLUI_DEFAULT_CONTROL_HEIGHT + 7; | ||
1262 | + w = GLUI_DEFAULT_CONTROL_WIDTH; | ||
1263 | + y_off_top = 21; | ||
1264 | + collapsible = true; | ||
1265 | + name = ""; | ||
1266 | + } | ||
1267 | +}; | ||
1268 | + | ||
1269 | +/************************************************************/ | ||
1270 | +/* */ | ||
1271 | +/* Tree Panel class (container) */ | ||
1272 | +/* JVK */ | ||
1273 | +/************************************************************/ | ||
1274 | + | ||
1275 | +/** | ||
1276 | + One collapsible entry in a GLUI_TreePanel. | ||
1277 | +*/ | ||
1278 | +class GLUIAPI GLUI_Tree : public GLUI_Panel | ||
1279 | +{ | ||
1280 | +public: | ||
1281 | + GLUI_Tree(GLUI_Node *parent, const char *name, | ||
1282 | + int open=false, int inset=0); | ||
1283 | + | ||
1284 | +private: | ||
1285 | + int level; // how deep is this node | ||
1286 | + float red; //Color coding of column line | ||
1287 | + float green; | ||
1288 | + float blue; | ||
1289 | + float lred; //Color coding of level name | ||
1290 | + float lgreen; | ||
1291 | + float lblue; | ||
1292 | + int id; | ||
1293 | + GLUI_Column *column; | ||
1294 | + int is_current; // Whether this tree is the | ||
1295 | + // current root in a treePanel | ||
1296 | + int child_number; | ||
1297 | + int format; | ||
1298 | + | ||
1299 | +public: | ||
1300 | + bool currently_inside, initially_inside; | ||
1301 | + GLUI_Button button; | ||
1302 | + GLUI_String level_name; // level name, eg: 1.1.2, III, or 3 | ||
1303 | + GLUI_TreePanel *panel; | ||
1304 | + | ||
1305 | + void draw( int x, int y ); | ||
1306 | + void draw_pressed( void ); | ||
1307 | + int mouse_down_handler( int local_x, int local_y ); | ||
1308 | + int mouse_up_handler( int local_x, int local_y, bool inside ); | ||
1309 | + int mouse_held_down_handler( int local_x, int local_y, bool inside ); | ||
1310 | + void set_column(GLUI_Column *c) { column = c; } | ||
1311 | + void open( void ); | ||
1312 | + void close( void ); | ||
1313 | + | ||
1314 | + /* void set_name( const char *text ) { panel.set_name( text ); }; */ | ||
1315 | + void update_size( void ); | ||
1316 | + void set_id(int i) { id = i; } | ||
1317 | + void set_level(int l) { level = l; } | ||
1318 | + void set_format(int f) { format = f; } | ||
1319 | + void set_current(int c) { is_current = c; } | ||
1320 | + int get_id() { return id; } | ||
1321 | + int get_level() { return level; } | ||
1322 | + int get_child_number() { return child_number; } | ||
1323 | + void enable_bar() { if (column) { column->int_val = 1; set_color(red, green, blue); } } | ||
1324 | + void disable_bar() { if (column) { column->int_val = 0; } } | ||
1325 | + void set_child_number(int c) { child_number = c; } | ||
1326 | + void set_level_color(float r, float g, float b) { | ||
1327 | + lred = r; | ||
1328 | + lgreen = g; | ||
1329 | + lblue = b; | ||
1330 | + } | ||
1331 | + void set_color(float r, float g, float b) { | ||
1332 | + red = r; | ||
1333 | + green = g; | ||
1334 | + blue = b; | ||
1335 | + } | ||
1336 | +protected: | ||
1337 | + void common_init() | ||
1338 | + { | ||
1339 | + currently_inside = false; | ||
1340 | + initially_inside = false; | ||
1341 | + can_activate = true; | ||
1342 | + is_container = true; | ||
1343 | + h = GLUI_DEFAULT_CONTROL_HEIGHT + 7; | ||
1344 | + w = GLUI_DEFAULT_CONTROL_WIDTH; | ||
1345 | + y_off_top = 21; | ||
1346 | + collapsible = true; | ||
1347 | + red = .5; | ||
1348 | + green = .5; | ||
1349 | + blue = .5; | ||
1350 | + lred = 0; | ||
1351 | + lgreen = 0; | ||
1352 | + lblue = 0; | ||
1353 | + column = NULL; | ||
1354 | + is_current = 0; | ||
1355 | + child_number = 0; | ||
1356 | + format = 0; | ||
1357 | + panel = NULL; | ||
1358 | + name = ""; | ||
1359 | + level_name = ""; | ||
1360 | + level = 0; | ||
1361 | + | ||
1362 | + }; | ||
1363 | +}; | ||
1364 | + | ||
1365 | + | ||
1366 | +/************************************************************/ | ||
1367 | +/* */ | ||
1368 | +/* TreePanel class (container) JVK */ | ||
1369 | +/* */ | ||
1370 | +/************************************************************/ | ||
1371 | + | ||
1372 | +/** | ||
1373 | + Manages, maintains, and formats a tree of GLUI_Tree objects. | ||
1374 | + These are shown in a heirarchical, collapsible display. | ||
1375 | + | ||
1376 | + FIXME: There's an infinite loop in the traversal code (OSL 2006/06) | ||
1377 | +*/ | ||
1378 | +class GLUIAPI GLUI_TreePanel : public GLUI_Panel | ||
1379 | +{ | ||
1380 | +public: | ||
1381 | + GLUI_TreePanel(GLUI_Node *parent, const char *name, | ||
1382 | + bool open=false, int inset=0); | ||
1383 | + | ||
1384 | + int max_levels; | ||
1385 | + int next_id; | ||
1386 | + int format; | ||
1387 | + float red; | ||
1388 | + float green; | ||
1389 | + float blue; | ||
1390 | + float lred; | ||
1391 | + float lgreen; | ||
1392 | + float lblue; | ||
1393 | + int root_children; | ||
1394 | + /* These variables allow the tree panel to traverse the tree | ||
1395 | + using only two function calls. (Well, four, if you count | ||
1396 | + going in reverse */ | ||
1397 | + | ||
1398 | + GLUI_Tree *curr_branch; /* Current Branch */ | ||
1399 | + GLUI_Panel *curr_root; /* Current Root */ | ||
1400 | + | ||
1401 | +public: | ||
1402 | + void set_color(float r, float g, float b); | ||
1403 | + void set_level_color(float r, float g, float b); | ||
1404 | + void set_format(int f) { format = f; } | ||
1405 | + | ||
1406 | + /* Adds branch to curr_root */ | ||
1407 | + GLUI_Tree * ab(const char *name, GLUI_Tree *root = NULL); | ||
1408 | + /* Goes up one level, resets curr_root and curr_branch to parents*/ | ||
1409 | + void fb(GLUI_Tree *branch= NULL); | ||
1410 | + /* Deletes the curr_branch, goes up one level using fb */ | ||
1411 | + void db(GLUI_Tree *branch = NULL); | ||
1412 | + /* Finds the very last branch of curr_root, resets vars */ | ||
1413 | + void descendBranch(GLUI_Panel *root = NULL); | ||
1414 | + /* Resets curr_root and curr branch to TreePanel and lastChild */ | ||
1415 | + void resetToRoot(GLUI_Panel *new_root = NULL); | ||
1416 | + void next( void ); | ||
1417 | + void refresh( void ); | ||
1418 | + void expand_all( void ); | ||
1419 | + void collapse_all( void ); | ||
1420 | + void update_all( void ); | ||
1421 | + void initNode(GLUI_Tree *temp); | ||
1422 | + void formatNode(GLUI_Tree *temp); | ||
1423 | + | ||
1424 | +protected: | ||
1425 | + int uniqueID( void ) { next_id++; return next_id - 1; } | ||
1426 | + void common_init() | ||
1427 | + { | ||
1428 | + GLUI_Panel(); | ||
1429 | + next_id = 0; | ||
1430 | + curr_root = this; | ||
1431 | + curr_branch = NULL; | ||
1432 | + red = .5; | ||
1433 | + green = .5; | ||
1434 | + blue = .5; | ||
1435 | + root_children = 0; | ||
1436 | + } | ||
1437 | +}; | ||
1438 | + | ||
1439 | +/************************************************************/ | ||
1440 | +/* */ | ||
1441 | +/* User-Level GLUI class */ | ||
1442 | +/* */ | ||
1443 | +/************************************************************/ | ||
1444 | + | ||
1445 | +class GLUI_Rotation; | ||
1446 | +class GLUI_Translation; | ||
1447 | + | ||
1448 | +/** | ||
1449 | + The main user-visible interface object to GLUI. | ||
1450 | + | ||
1451 | +*/ | ||
1452 | +class GLUIAPI GLUI : public GLUI_Main | ||
1453 | +{ | ||
1454 | +public: | ||
1455 | +/** DEPRECATED interface for creating new GLUI objects */ | ||
1456 | + int add_control( GLUI_Control *control ) { return main_panel->add_control(control); } | ||
1457 | + | ||
1458 | + void add_column( int draw_bar = true ); | ||
1459 | + void add_column_to_panel( GLUI_Panel *panel, int draw_bar = true ); | ||
1460 | + | ||
1461 | + void add_separator( void ); | ||
1462 | + void add_separator_to_panel( GLUI_Panel *panel ); | ||
1463 | + | ||
1464 | + GLUI_RadioGroup | ||
1465 | + *add_radiogroup( int *live_var=NULL, | ||
1466 | + int user_id=-1,GLUI_CB callback=GLUI_CB()); | ||
1467 | + | ||
1468 | + GLUI_RadioGroup | ||
1469 | + *add_radiogroup_to_panel( GLUI_Panel *panel, | ||
1470 | + int *live_var=NULL, | ||
1471 | + int user_id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1472 | + GLUI_RadioButton | ||
1473 | + *add_radiobutton_to_group( GLUI_RadioGroup *group, | ||
1474 | + const char *name ); | ||
1475 | + | ||
1476 | + GLUI_Listbox *add_listbox( const char *name, int *live_var=NULL, | ||
1477 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1478 | + GLUI_Listbox *add_listbox_to_panel( GLUI_Panel *panel, | ||
1479 | + const char *name, int *live_var=NULL, | ||
1480 | + int id=-1, GLUI_CB callback=GLUI_CB()); | ||
1481 | + | ||
1482 | + GLUI_Rotation *add_rotation( const char *name, float *live_var=NULL, | ||
1483 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1484 | + GLUI_Rotation *add_rotation_to_panel( GLUI_Panel *panel, | ||
1485 | + const char *name, float *live_var=NULL, | ||
1486 | + int id=-1, GLUI_CB callback=GLUI_CB()); | ||
1487 | + | ||
1488 | + GLUI_Translation *add_translation( const char *name, | ||
1489 | + int trans_type, float *live_var=NULL, | ||
1490 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1491 | + GLUI_Translation *add_translation_to_panel( | ||
1492 | + GLUI_Panel *panel, const char *name, | ||
1493 | + int trans_type, float *live_var=NULL, | ||
1494 | + int id=-1, GLUI_CB callback=GLUI_CB()); | ||
1495 | + | ||
1496 | + GLUI_Checkbox *add_checkbox( const char *name, | ||
1497 | + int *live_var=NULL, | ||
1498 | + int id=-1, GLUI_CB callback=GLUI_CB()); | ||
1499 | + GLUI_Checkbox *add_checkbox_to_panel( GLUI_Panel *panel, const char *name, | ||
1500 | + int *live_var=NULL, int id=-1, | ||
1501 | + GLUI_CB callback=GLUI_CB()); | ||
1502 | + | ||
1503 | + GLUI_Button *add_button( const char *name, int id=-1, | ||
1504 | + GLUI_CB callback=GLUI_CB()); | ||
1505 | + GLUI_Button *add_button_to_panel( GLUI_Panel *panel, const char *name, | ||
1506 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1507 | + | ||
1508 | + GLUI_StaticText *add_statictext( const char *name ); | ||
1509 | + GLUI_StaticText *add_statictext_to_panel( GLUI_Panel *panel, const char *name ); | ||
1510 | + | ||
1511 | + GLUI_EditText *add_edittext( const char *name, | ||
1512 | + int data_type=GLUI_EDITTEXT_TEXT, | ||
1513 | + void*live_var=NULL, | ||
1514 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1515 | + GLUI_EditText *add_edittext_to_panel( GLUI_Panel *panel, | ||
1516 | + const char *name, | ||
1517 | + int data_type=GLUI_EDITTEXT_TEXT, | ||
1518 | + void *live_var=NULL, int id=-1, | ||
1519 | + GLUI_CB callback=GLUI_CB() ); | ||
1520 | + GLUI_EditText *add_edittext( const char *name, GLUI_String& live_var, | ||
1521 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1522 | + GLUI_EditText *add_edittext_to_panel( GLUI_Panel *panel, const char *name, | ||
1523 | + GLUI_String& live_var, int id=-1, | ||
1524 | + GLUI_CB callback=GLUI_CB() ); | ||
1525 | + | ||
1526 | + GLUI_Spinner *add_spinner( const char *name, | ||
1527 | + int data_type=GLUI_SPINNER_INT, | ||
1528 | + void *live_var=NULL, | ||
1529 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1530 | + GLUI_Spinner *add_spinner_to_panel( GLUI_Panel *panel, | ||
1531 | + const char *name, | ||
1532 | + int data_type=GLUI_SPINNER_INT, | ||
1533 | + void *live_var=NULL, | ||
1534 | + int id=-1, | ||
1535 | + GLUI_CB callback=GLUI_CB() ); | ||
1536 | + | ||
1537 | + GLUI_Panel *add_panel( const char *name, int type=GLUI_PANEL_EMBOSSED ); | ||
1538 | + GLUI_Panel *add_panel_to_panel( GLUI_Panel *panel, const char *name, | ||
1539 | + int type=GLUI_PANEL_EMBOSSED ); | ||
1540 | + | ||
1541 | + | ||
1542 | + GLUI_Rollout *add_rollout( const char *name, int open=true, | ||
1543 | + int type=GLUI_PANEL_EMBOSSED); | ||
1544 | + GLUI_Rollout *add_rollout_to_panel( GLUI_Panel *panel, const char *name, | ||
1545 | + int open=true, | ||
1546 | + int type=GLUI_PANEL_EMBOSSED); | ||
1547 | + | ||
1548 | + | ||
1549 | +/** Set the window where our widgets should be displayed. */ | ||
1550 | + void set_main_gfx_window( int window_id ); | ||
1551 | + int get_glut_window_id( void ) { return glut_window_id; } | ||
1552 | + | ||
1553 | + void enable( void ) { main_panel->enable(); } | ||
1554 | + void disable( void ); | ||
1555 | + | ||
1556 | + void sync_live( void ); | ||
1557 | + | ||
1558 | + void close( void ); | ||
1559 | + | ||
1560 | + void show( void ); | ||
1561 | + void hide( void ); | ||
1562 | + | ||
1563 | + /***** GLUT callback setup functions *****/ | ||
1564 | + /* | ||
1565 | + void set_glutDisplayFunc(void (*f)(void)); | ||
1566 | + void set_glutReshapeFunc(void (*f)(int width, int height)); | ||
1567 | + void set_glutKeyboardFunc(void (*f)(unsigned char key, int x, int y)); | ||
1568 | + void set_glutSpecialFunc(void (*f)(int key, int x, int y)); | ||
1569 | + void set_glutMouseFunc(void (*f)(int button, int state, int x, int y)); | ||
1570 | + void set_glutMotionFunc(void (*f)(int x, int y)); | ||
1571 | + void set_glutPassiveMotionFunc(void (*f)(int x, int y)); | ||
1572 | + void set_glutEntryFunc(void (*f)(int state)); | ||
1573 | + void set_glutVisibilityFunc(void (*f)(int state)); | ||
1574 | + void set_glutInit( int *argcp, const char **argv ); | ||
1575 | + void set_glutInitWindowSize(int width, int height); | ||
1576 | + void set_glutInitWindowPosition(int x, int y); | ||
1577 | + void set_glutInitDisplayMode(unsigned int mode); | ||
1578 | + int set_glutCreateWindow(const char *name); | ||
1579 | + */ | ||
1580 | + | ||
1581 | + /***** Constructors and desctructors *****/ | ||
1582 | + | ||
1583 | + int init( const char *name, long flags, int x, int y, int parent_window ); | ||
1584 | +protected: | ||
1585 | + virtual int add_control( GLUI_Node *parent, GLUI_Control *control ) { | ||
1586 | + return GLUI_Main::add_control( parent, control ); | ||
1587 | + } | ||
1588 | +}; | ||
1589 | + | ||
1590 | +/************************************************************/ | ||
1591 | +/* */ | ||
1592 | +/* EditText class */ | ||
1593 | +/* */ | ||
1594 | +/************************************************************/ | ||
1595 | + | ||
1596 | +class GLUIAPI GLUI_EditText : public GLUI_Control | ||
1597 | +{ | ||
1598 | +public: | ||
1599 | + int has_limits; | ||
1600 | + int data_type; | ||
1601 | + GLUI_String orig_text; | ||
1602 | + int insertion_pt; | ||
1603 | + int title_x_offset; | ||
1604 | + int text_x_offset; | ||
1605 | + int substring_start; /*substring that gets displayed in box*/ | ||
1606 | + int substring_end; | ||
1607 | + int sel_start, sel_end; /* current selection */ | ||
1608 | + int num_periods; | ||
1609 | + int last_insertion_pt; | ||
1610 | + float float_low, float_high; | ||
1611 | + int int_low, int_high; | ||
1612 | + GLUI_Spinner *spinner; | ||
1613 | + int debug; | ||
1614 | + int draw_text_only; | ||
1615 | + | ||
1616 | + | ||
1617 | + int mouse_down_handler( int local_x, int local_y ); | ||
1618 | + int mouse_up_handler( int local_x, int local_y, bool inside ); | ||
1619 | + int mouse_held_down_handler( int local_x, int local_y, bool inside ); | ||
1620 | + int key_handler( unsigned char key,int modifiers ); | ||
1621 | + int special_handler( int key, int modifiers ); | ||
1622 | + | ||
1623 | + void activate( int how ); | ||
1624 | + void deactivate( void ); | ||
1625 | + | ||
1626 | + void draw( int x, int y ); | ||
1627 | + | ||
1628 | + int mouse_over( int state, int x, int y ); | ||
1629 | + | ||
1630 | + int find_word_break( int start, int direction ); | ||
1631 | + int substring_width( int start, int end ); | ||
1632 | + void clear_substring( int start, int end ); | ||
1633 | + int find_insertion_pt( int x, int y ); | ||
1634 | + int update_substring_bounds( void ); | ||
1635 | + void update_and_draw_text( void ); | ||
1636 | + void draw_text( int x, int y ); | ||
1637 | + void draw_insertion_pt( void ); | ||
1638 | + void set_numeric_text( void ); | ||
1639 | + void update_x_offsets( void ); | ||
1640 | + void update_size( void ); | ||
1641 | + | ||
1642 | + void set_float_limits( float low,float high,int limit_type=GLUI_LIMIT_CLAMP); | ||
1643 | + void set_int_limits( int low, int high, int limit_type=GLUI_LIMIT_CLAMP ); | ||
1644 | + void set_float_val( float new_val ); | ||
1645 | + void set_int_val( int new_val ); | ||
1646 | + void set_text( const char *text ); | ||
1647 | + void set_text( const GLUI_String &s) { set_text(s.c_str()); } | ||
1648 | + const char *get_text() { return text.c_str(); } | ||
1649 | + | ||
1650 | + void dump( FILE *out, const char *text ); | ||
1651 | + | ||
1652 | + // Constructor, no live variable | ||
1653 | + GLUI_EditText( GLUI_Node *parent, const char *name, | ||
1654 | + int text_type=GLUI_EDITTEXT_TEXT, | ||
1655 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1656 | + // Constructor, int live variable | ||
1657 | + GLUI_EditText( GLUI_Node *parent, const char *name, | ||
1658 | + int *live_var, | ||
1659 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1660 | + // Constructor, float live variable | ||
1661 | + GLUI_EditText( GLUI_Node *parent, const char *name, | ||
1662 | + float *live_var, | ||
1663 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1664 | + // Constructor, char* live variable | ||
1665 | + GLUI_EditText( GLUI_Node *parent, const char *name, | ||
1666 | + char *live_var, | ||
1667 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1668 | + // Constructor, std::string live variable | ||
1669 | + GLUI_EditText( GLUI_Node *parent, const char *name, | ||
1670 | + std::string &live_var, | ||
1671 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1672 | + | ||
1673 | + // Deprecated constructor, only called internally | ||
1674 | + GLUI_EditText( GLUI_Node *parent, const char *name, | ||
1675 | + int text_type, void *live_var, | ||
1676 | + int id, GLUI_CB callback ); | ||
1677 | + // Deprecated constructor, only called internally | ||
1678 | + GLUI_EditText( void ) { common_init(); } | ||
1679 | + | ||
1680 | +protected: | ||
1681 | + void common_init( void ) { | ||
1682 | + h = GLUI_EDITTEXT_HEIGHT; | ||
1683 | + w = GLUI_EDITTEXT_WIDTH; | ||
1684 | + title_x_offset = 0; | ||
1685 | + text_x_offset = 55; | ||
1686 | + insertion_pt = -1; | ||
1687 | + last_insertion_pt = -1; | ||
1688 | + name = ""; | ||
1689 | + substring_start = 0; | ||
1690 | + data_type = GLUI_EDITTEXT_TEXT; | ||
1691 | + substring_end = 2; | ||
1692 | + num_periods = 0; | ||
1693 | + has_limits = GLUI_LIMIT_NONE; | ||
1694 | + sel_start = 0; | ||
1695 | + sel_end = 0; | ||
1696 | + active_type = GLUI_CONTROL_ACTIVE_PERMANENT; | ||
1697 | + can_activate = true; | ||
1698 | + spacebar_mouse_click = false; | ||
1699 | + spinner = NULL; | ||
1700 | + debug = false; | ||
1701 | + draw_text_only = false; | ||
1702 | + } | ||
1703 | + void common_construct( GLUI_Node *parent, const char *name, | ||
1704 | + int data_type, int live_type, void *live_var, | ||
1705 | + int id, GLUI_CB callback ); | ||
1706 | +}; | ||
1707 | + | ||
1708 | +/************************************************************/ | ||
1709 | +/* */ | ||
1710 | +/* CommandLine class */ | ||
1711 | +/* */ | ||
1712 | +/************************************************************/ | ||
1713 | + | ||
1714 | +//moved here to make it compile in VS2010(can only do this in namespace scope). | ||
1715 | +#ifdef _MSC_VER | ||
1716 | +// Explicit template instantiation needed for dll | ||
1717 | +template class GLUIAPI std::allocator<GLUI_String>; | ||
1718 | +template class GLUIAPI std::vector<GLUI_String, std::allocator<GLUI_String> >; | ||
1719 | +#endif | ||
1720 | + | ||
1721 | +class GLUIAPI GLUI_CommandLine : public GLUI_EditText | ||
1722 | +{ | ||
1723 | +public: | ||
1724 | + typedef GLUI_EditText Super; | ||
1725 | + | ||
1726 | + enum { HIST_SIZE = 100 }; | ||
1727 | + | ||
1728 | + std::vector<GLUI_String> hist_list; | ||
1729 | + int curr_hist; | ||
1730 | + int oldest_hist; | ||
1731 | + int newest_hist; | ||
1732 | + bool commit_flag; | ||
1733 | + | ||
1734 | +public: | ||
1735 | + int key_handler( unsigned char key,int modifiers ); | ||
1736 | + int special_handler( int key,int modifiers ); | ||
1737 | + void deactivate( void ); | ||
1738 | + | ||
1739 | + virtual const char *get_history( int command_number ) const | ||
1740 | + { return hist_list[command_number - oldest_hist].c_str(); } | ||
1741 | + virtual GLUI_String& get_history_str( int command_number ) | ||
1742 | + { return hist_list[command_number - oldest_hist]; } | ||
1743 | + virtual const GLUI_String& get_history_str( int command_number ) const | ||
1744 | + { return hist_list[command_number - oldest_hist]; } | ||
1745 | + virtual void recall_history( int history_number ); | ||
1746 | + virtual void scroll_history( int direction ); | ||
1747 | + virtual void add_to_history( const char *text ); | ||
1748 | + virtual void reset_history( void ); | ||
1749 | + | ||
1750 | + void dump( FILE *out, const char *text ); | ||
1751 | + | ||
1752 | + | ||
1753 | + GLUI_CommandLine( GLUI_Node *parent, const char *name, void *live_var=NULL, | ||
1754 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1755 | + GLUI_CommandLine( void ) { common_init(); } | ||
1756 | +protected: | ||
1757 | + void common_init() { | ||
1758 | + hist_list.resize(HIST_SIZE); | ||
1759 | + curr_hist = 0; | ||
1760 | + oldest_hist = 0; | ||
1761 | + newest_hist = 0; | ||
1762 | + commit_flag = false; | ||
1763 | + } | ||
1764 | + | ||
1765 | +}; | ||
1766 | + | ||
1767 | +/************************************************************/ | ||
1768 | +/* */ | ||
1769 | +/* RadioGroup class (container) */ | ||
1770 | +/* */ | ||
1771 | +/************************************************************/ | ||
1772 | + | ||
1773 | +class GLUIAPI GLUI_RadioGroup : public GLUI_Control | ||
1774 | +{ | ||
1775 | +public: | ||
1776 | + int num_buttons; | ||
1777 | + | ||
1778 | + void draw( int x, int y ); | ||
1779 | + void set_name( const char *text ); | ||
1780 | + void set_int_val( int int_val ); | ||
1781 | + void set_selected( int int_val ); | ||
1782 | + | ||
1783 | + void draw_group( int translate ); | ||
1784 | + | ||
1785 | + GLUI_RadioGroup( GLUI_Node *parent, int *live_var=NULL, | ||
1786 | + int user_id=-1,GLUI_CB callback=GLUI_CB() ); | ||
1787 | + GLUI_RadioGroup( void ) { common_init(); } | ||
1788 | + | ||
1789 | +protected: | ||
1790 | + void common_init( void ) { | ||
1791 | + x_off = 0; | ||
1792 | + y_off_top = 0; | ||
1793 | + y_off_bot = 0; | ||
1794 | + is_container = true; | ||
1795 | + w = 300; | ||
1796 | + h = 300; | ||
1797 | + num_buttons = 0; | ||
1798 | + name = ""; | ||
1799 | + can_activate = false; | ||
1800 | + live_type = GLUI_LIVE_INT; | ||
1801 | + } | ||
1802 | +}; | ||
1803 | + | ||
1804 | +/************************************************************/ | ||
1805 | +/* */ | ||
1806 | +/* RadioButton class (container) */ | ||
1807 | +/* */ | ||
1808 | +/************************************************************/ | ||
1809 | + | ||
1810 | +class GLUIAPI GLUI_RadioButton : public GLUI_Control | ||
1811 | +{ | ||
1812 | +public: | ||
1813 | + int orig_value; | ||
1814 | + bool currently_inside; | ||
1815 | + int text_x_offset; | ||
1816 | + | ||
1817 | + int mouse_down_handler( int local_x, int local_y ); | ||
1818 | + int mouse_up_handler( int local_x, int local_y, bool inside ); | ||
1819 | + int mouse_held_down_handler( int local_x, int local_y, bool inside ); | ||
1820 | + | ||
1821 | + void draw( int x, int y ); | ||
1822 | + void update_size( void ); | ||
1823 | + | ||
1824 | + void draw_active_area( void ); | ||
1825 | + void draw_checked( void ); | ||
1826 | + void draw_unchecked( void ); | ||
1827 | + void draw_O( void ); | ||
1828 | + | ||
1829 | + GLUI_RadioButton( GLUI_RadioGroup *group, const char *name ); | ||
1830 | + GLUI_RadioGroup *group; | ||
1831 | + | ||
1832 | +protected: | ||
1833 | + void common_init() | ||
1834 | + { | ||
1835 | + glui_format_str( name, "RadioButton: %p", (void *) this ); | ||
1836 | + h = GLUI_RADIOBUTTON_SIZE; | ||
1837 | + group = NULL; | ||
1838 | + orig_value = -1; | ||
1839 | + text_x_offset = 18; | ||
1840 | + can_activate = true; | ||
1841 | + } | ||
1842 | +}; | ||
1843 | + | ||
1844 | + | ||
1845 | +/************************************************************/ | ||
1846 | +/* */ | ||
1847 | +/* Separator class (container) */ | ||
1848 | +/* */ | ||
1849 | +/************************************************************/ | ||
1850 | + | ||
1851 | +class GLUIAPI GLUI_Separator : public GLUI_Control | ||
1852 | +{ | ||
1853 | +public: | ||
1854 | + void draw( int x, int y ); | ||
1855 | + | ||
1856 | + GLUI_Separator( GLUI_Node *parent ); | ||
1857 | + GLUI_Separator( void ) { common_init(); } | ||
1858 | + | ||
1859 | +protected: | ||
1860 | + void common_init() { | ||
1861 | + w = 100; | ||
1862 | + h = GLUI_SEPARATOR_HEIGHT; | ||
1863 | + can_activate = false; | ||
1864 | + } | ||
1865 | +}; | ||
1866 | + | ||
1867 | +#define GLUI_SPINNER_ARROW_WIDTH 12 | ||
1868 | +#define GLUI_SPINNER_ARROW_HEIGHT 8 | ||
1869 | +#define GLUI_SPINNER_ARROW_Y 2 | ||
1870 | + | ||
1871 | +#define GLUI_SPINNER_STATE_NONE 0 | ||
1872 | +#define GLUI_SPINNER_STATE_UP 1 | ||
1873 | +#define GLUI_SPINNER_STATE_DOWN 2 | ||
1874 | +#define GLUI_SPINNER_STATE_BOTH 3 | ||
1875 | + | ||
1876 | +#define GLUI_SPINNER_DEFAULT_GROWTH_EXP 1.05f | ||
1877 | + | ||
1878 | +/************************************************************/ | ||
1879 | +/* */ | ||
1880 | +/* Spinner class (container) */ | ||
1881 | +/* */ | ||
1882 | +/************************************************************/ | ||
1883 | + | ||
1884 | +class GLUIAPI GLUI_Spinner : public GLUI_Control | ||
1885 | +{ | ||
1886 | +public: | ||
1887 | + // Constructor, no live var | ||
1888 | + GLUI_Spinner( GLUI_Node* parent, const char *name, | ||
1889 | + int data_type=GLUI_SPINNER_INT, int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1890 | + // Constructor, int live var | ||
1891 | + GLUI_Spinner( GLUI_Node* parent, const char *name, | ||
1892 | + int *live_var, int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1893 | + // Constructor, float live var | ||
1894 | + GLUI_Spinner( GLUI_Node* parent, const char *name, | ||
1895 | + float *live_var, int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1896 | + // Deprecated constructor | ||
1897 | + GLUI_Spinner( GLUI_Node* parent, const char *name, | ||
1898 | + int data_type, | ||
1899 | + void *live_var, | ||
1900 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
1901 | + // Deprecated constructor | ||
1902 | + GLUI_Spinner( void ) { common_init(); } | ||
1903 | + | ||
1904 | + bool currently_inside; | ||
1905 | + int state; | ||
1906 | + float growth, growth_exp; | ||
1907 | + int last_x, last_y; | ||
1908 | + int data_type; | ||
1909 | + int callback_count; | ||
1910 | + int last_int_val; | ||
1911 | + float last_float_val; | ||
1912 | + int first_callback; | ||
1913 | + float user_speed; | ||
1914 | + | ||
1915 | + GLUI_EditText *edittext; | ||
1916 | + | ||
1917 | + int mouse_down_handler( int local_x, int local_y ); | ||
1918 | + int mouse_up_handler( int local_x, int local_y, bool inside ); | ||
1919 | + int mouse_held_down_handler( int local_x, int local_y, bool inside ); | ||
1920 | + int key_handler( unsigned char key,int modifiers ); | ||
1921 | + int special_handler( int key,int modifiers ); | ||
1922 | + | ||
1923 | + void draw( int x, int y ); | ||
1924 | + void draw_pressed( void ); | ||
1925 | + void draw_unpressed( void ); | ||
1926 | + void draw_text( int sunken ); | ||
1927 | + | ||
1928 | + void update_size( void ); | ||
1929 | + | ||
1930 | + void set_float_limits( float low,float high,int limit_type=GLUI_LIMIT_CLAMP); | ||
1931 | + void set_int_limits( int low, int high,int limit_type=GLUI_LIMIT_CLAMP); | ||
1932 | + int find_arrow( int local_x, int local_y ); | ||
1933 | + void do_drag( int x, int y ); | ||
1934 | + void do_callbacks( void ); | ||
1935 | + void do_click( void ); | ||
1936 | + void idle( void ); | ||
1937 | + bool needs_idle( void ) const; | ||
1938 | + | ||
1939 | + const char *get_text( void ); | ||
1940 | + | ||
1941 | + void set_float_val( float new_val ); | ||
1942 | + void set_int_val( int new_val ); | ||
1943 | + float get_float_val( void ); | ||
1944 | + int get_int_val( void ); | ||
1945 | + void increase_growth( void ); | ||
1946 | + void reset_growth( void ); | ||
1947 | + | ||
1948 | + void set_speed( float speed ) { user_speed = speed; } | ||
1949 | + | ||
1950 | +protected: | ||
1951 | + void common_init() { | ||
1952 | + glui_format_str( name, "Spinner: %p", this ); | ||
1953 | + h = GLUI_EDITTEXT_HEIGHT; | ||
1954 | + w = GLUI_EDITTEXT_WIDTH; | ||
1955 | + x_off = 0; | ||
1956 | + y_off_top = 0; | ||
1957 | + y_off_bot = 0; | ||
1958 | + can_activate = true; | ||
1959 | + state = GLUI_SPINNER_STATE_NONE; | ||
1960 | + edittext = NULL; | ||
1961 | + growth_exp = GLUI_SPINNER_DEFAULT_GROWTH_EXP; | ||
1962 | + callback_count = 0; | ||
1963 | + first_callback = true; | ||
1964 | + user_speed = 1.0; | ||
1965 | + } | ||
1966 | + void common_construct( GLUI_Node* parent, const char *name, | ||
1967 | + int data_type, void *live_var, | ||
1968 | + int id, GLUI_CB callback ); | ||
1969 | +}; | ||
1970 | + | ||
1971 | +/************************************************************/ | ||
1972 | +/* */ | ||
1973 | +/* StaticText class */ | ||
1974 | +/* */ | ||
1975 | +/************************************************************/ | ||
1976 | + | ||
1977 | +class GLUIAPI GLUI_StaticText : public GLUI_Control | ||
1978 | +{ | ||
1979 | +public: | ||
1980 | + void set_text( const char *text ); | ||
1981 | + void draw( int x, int y ); | ||
1982 | + void draw_text( void ); | ||
1983 | + void update_size( void ); | ||
1984 | + void erase_text( void ); | ||
1985 | + | ||
1986 | + GLUI_StaticText(GLUI_Node *parent, const char *name); | ||
1987 | + GLUI_StaticText( void ) { common_init(); } | ||
1988 | + | ||
1989 | +protected: | ||
1990 | + void common_init() { | ||
1991 | + h = GLUI_STATICTEXT_SIZE; | ||
1992 | + name = ""; | ||
1993 | + can_activate = false; | ||
1994 | + } | ||
1995 | +}; | ||
1996 | + | ||
1997 | +/************************************************************/ | ||
1998 | +/* */ | ||
1999 | +/* TextBox class - JVK */ | ||
2000 | +/* */ | ||
2001 | +/************************************************************/ | ||
2002 | + | ||
2003 | +class GLUIAPI GLUI_TextBox : public GLUI_Control | ||
2004 | +{ | ||
2005 | +public: | ||
2006 | + /* GLUI Textbox - JVK */ | ||
2007 | + GLUI_TextBox(GLUI_Node *parent, GLUI_String &live_var, | ||
2008 | + bool scroll = false, int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
2009 | + GLUI_TextBox( GLUI_Node *parent, | ||
2010 | + bool scroll = false, int id=-1, | ||
2011 | + GLUI_CB callback=GLUI_CB() ); | ||
2012 | + | ||
2013 | + GLUI_String orig_text; | ||
2014 | + int insertion_pt; | ||
2015 | + int substring_start; /*substring that gets displayed in box*/ | ||
2016 | + int substring_end; | ||
2017 | + int sel_start, sel_end; /* current selection */ | ||
2018 | + int last_insertion_pt; | ||
2019 | + int debug; | ||
2020 | + int draw_text_only; | ||
2021 | + int tab_width; | ||
2022 | + int start_line; | ||
2023 | + int num_lines; | ||
2024 | + int curr_line; | ||
2025 | + int visible_lines; | ||
2026 | + int insert_x; /* Similar to "insertion_pt", these variables keep */ | ||
2027 | + int insert_y; /* track of where the ptr is, but in pixels */ | ||
2028 | + int keygoal_x; /* where up down keys would like to put insertion pt*/ | ||
2029 | + GLUI_Scrollbar *scrollbar; | ||
2030 | + // EG: Added | ||
2031 | + bool continuous_callback; | ||
2032 | + | ||
2033 | + int mouse_down_handler( int local_x, int local_y ); | ||
2034 | + int mouse_up_handler( int local_x, int local_y, bool inside ); | ||
2035 | + int mouse_held_down_handler( int local_x, int local_y, bool inside ); | ||
2036 | + int key_handler( unsigned char key,int modifiers ); | ||
2037 | + int special_handler( int key,int modifiers ); | ||
2038 | + | ||
2039 | + void activate( int how ); | ||
2040 | + void deactivate( void ); | ||
2041 | + | ||
2042 | + void enable( void ); | ||
2043 | + void disable( void ); | ||
2044 | + | ||
2045 | + void draw( int x, int y ); | ||
2046 | + | ||
2047 | + int mouse_over( int state, int x, int y ); | ||
2048 | + | ||
2049 | + int get_box_width(); | ||
2050 | + int find_word_break( int start, int direction ); | ||
2051 | + int substring_width( int start, int end, int initial_width=0 ); | ||
2052 | + void clear_substring( int start, int end ); | ||
2053 | + int find_insertion_pt( int x, int y ); | ||
2054 | + int update_substring_bounds( void ); | ||
2055 | + void update_and_draw_text( void ); | ||
2056 | + void draw_text( int x, int y ); | ||
2057 | + void draw_insertion_pt( void ); | ||
2058 | + void update_x_offsets( void ); | ||
2059 | + void update_size( void ); | ||
2060 | + | ||
2061 | + void set_text( const char *text ); | ||
2062 | + const char *get_text( void ) { return text.c_str(); } | ||
2063 | + | ||
2064 | + void dump( FILE *out, char *text ); | ||
2065 | + void set_tab_w(int w) { tab_width = w; } | ||
2066 | + void set_start_line(int l) { start_line = l; } | ||
2067 | + static void scrollbar_callback(GLUI_Control*); | ||
2068 | + | ||
2069 | + bool wants_tabs( void ) const { return true; } | ||
2070 | + | ||
2071 | +protected: | ||
2072 | + void common_init() | ||
2073 | + { | ||
2074 | + h = GLUI_TEXTBOX_HEIGHT; | ||
2075 | + w = GLUI_TEXTBOX_WIDTH; | ||
2076 | + tab_width = GLUI_TAB_WIDTH; | ||
2077 | + num_lines = 0; | ||
2078 | + visible_lines = 0; | ||
2079 | + start_line = 0; | ||
2080 | + curr_line = 0; | ||
2081 | + insert_y = -1; | ||
2082 | + insert_x = -1; | ||
2083 | + insertion_pt = -1; | ||
2084 | + last_insertion_pt = -1; | ||
2085 | + name[0] = '\0'; | ||
2086 | + substring_start = 0; | ||
2087 | + substring_end = 2; | ||
2088 | + sel_start = 0; | ||
2089 | + sel_end = 0; | ||
2090 | + active_type = GLUI_CONTROL_ACTIVE_PERMANENT; | ||
2091 | + can_activate = true; | ||
2092 | + spacebar_mouse_click = false; | ||
2093 | + scrollbar = NULL; | ||
2094 | + debug = false; | ||
2095 | + draw_text_only = false; | ||
2096 | + } | ||
2097 | + void common_construct( | ||
2098 | + GLUI_Node *parent, GLUI_String *live_var, | ||
2099 | + bool scroll, int id, GLUI_CB callback); | ||
2100 | +}; | ||
2101 | + | ||
2102 | +/************************************************************/ | ||
2103 | +/* */ | ||
2104 | +/* List class - JVK */ | ||
2105 | +/* */ | ||
2106 | +/************************************************************/ | ||
2107 | + | ||
2108 | +class GLUIAPI GLUI_List_Item : public GLUI_Node | ||
2109 | +{ | ||
2110 | +public: | ||
2111 | + GLUI_String text; | ||
2112 | + int id; | ||
2113 | +}; | ||
2114 | + | ||
2115 | +/************************************************************/ | ||
2116 | +/* */ | ||
2117 | +/* List class - JVK */ | ||
2118 | +/* */ | ||
2119 | +/************************************************************/ | ||
2120 | + | ||
2121 | +class GLUIAPI GLUI_List : public GLUI_Control | ||
2122 | +{ | ||
2123 | +public: | ||
2124 | + /* GLUI List - JVK */ | ||
2125 | + GLUI_List( GLUI_Node *parent, bool scroll = false, | ||
2126 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
2127 | + /*, GLUI_Control *object = NULL | ||
2128 | + ,GLUI_InterObject_CB obj_cb = NULL);*/ | ||
2129 | + | ||
2130 | + GLUI_List( GLUI_Node *parent, | ||
2131 | + GLUI_String& live_var, bool scroll = false, | ||
2132 | + int id=-1, | ||
2133 | + GLUI_CB callback=GLUI_CB() | ||
2134 | + /*,GLUI_Control *object = NULL */ | ||
2135 | + /*,GLUI_InterObject_CB obj_cb = NULL*/); | ||
2136 | + | ||
2137 | + | ||
2138 | + GLUI_String orig_text; | ||
2139 | + int debug; | ||
2140 | + int draw_text_only; | ||
2141 | + int start_line; | ||
2142 | + int num_lines; | ||
2143 | + int curr_line; | ||
2144 | + int visible_lines; | ||
2145 | + GLUI_Scrollbar *scrollbar; | ||
2146 | + GLUI_List_Item items_list; | ||
2147 | + GLUI_Control *associated_object; | ||
2148 | + GLUI_CB obj_cb; | ||
2149 | + int cb_click_type; | ||
2150 | + int last_line; | ||
2151 | + int last_click_time; | ||
2152 | + | ||
2153 | + int mouse_down_handler( int local_x, int local_y ); | ||
2154 | + int mouse_up_handler( int local_x, int local_y, bool inside ); | ||
2155 | + int mouse_held_down_handler( int local_x, int local_y, bool inside ); | ||
2156 | + int key_handler( unsigned char key,int modifiers ); | ||
2157 | + int special_handler( int key,int modifiers ); | ||
2158 | + | ||
2159 | + void activate( int how ); | ||
2160 | + void deactivate( void ); | ||
2161 | + | ||
2162 | + void draw( int x, int y ); | ||
2163 | + | ||
2164 | + int mouse_over( int state, int x, int y ); | ||
2165 | + | ||
2166 | + int get_box_width(); | ||
2167 | + int find_word_break( int start, int direction ); | ||
2168 | + int substring_width( const char *t, int start, int end ); | ||
2169 | + int find_line( int x, int y ); | ||
2170 | + void update_and_draw_text( void ); | ||
2171 | + void draw_text( const char *t, int selected, int x, int y ); | ||
2172 | + void update_size( void ); | ||
2173 | + | ||
2174 | + | ||
2175 | + int add_item( int id, const char *text ); | ||
2176 | + int delete_item( const char *text ); | ||
2177 | + int delete_item( int id ); | ||
2178 | + int delete_all(); | ||
2179 | + | ||
2180 | + GLUI_List_Item *get_item_ptr( const char *text ); | ||
2181 | + GLUI_List_Item *get_item_ptr( int id ); | ||
2182 | + | ||
2183 | + void dump( FILE *out, const char *text ); | ||
2184 | + void set_start_line(int l) { start_line = l; } | ||
2185 | + static void scrollbar_callback(GLUI_Control*); | ||
2186 | + int get_current_item() { return curr_line; } | ||
2187 | + void set_click_type(int d) { | ||
2188 | + cb_click_type = d; } | ||
2189 | + void set_object_callback(GLUI_CB cb=GLUI_CB(), GLUI_Control*obj=NULL) | ||
2190 | + { obj_cb=cb; associated_object=obj; } | ||
2191 | + | ||
2192 | +protected: | ||
2193 | + void common_init() | ||
2194 | + { | ||
2195 | + h = GLUI_LIST_HEIGHT; | ||
2196 | + w = GLUI_LIST_WIDTH; | ||
2197 | + num_lines = 0; | ||
2198 | + visible_lines = 0; | ||
2199 | + start_line = 0; | ||
2200 | + curr_line = 0; | ||
2201 | + name[0] = '\0'; | ||
2202 | + active_type = GLUI_CONTROL_ACTIVE_PERMANENT; | ||
2203 | + can_activate = true; | ||
2204 | + spacebar_mouse_click = false; | ||
2205 | + scrollbar = NULL; | ||
2206 | + debug = false; | ||
2207 | + draw_text_only = false; | ||
2208 | + cb_click_type = GLUI_SINGLE_CLICK; | ||
2209 | + last_line = -1; | ||
2210 | + last_click_time = 0; | ||
2211 | + associated_object = NULL; | ||
2212 | + }; | ||
2213 | + void common_construct( | ||
2214 | + GLUI_Node *parent, | ||
2215 | + GLUI_String* live_var, bool scroll, | ||
2216 | + int id, | ||
2217 | + GLUI_CB callback | ||
2218 | + /*,GLUI_Control *object*/ | ||
2219 | + /*,GLUI_InterObject_CB obj_cb*/); | ||
2220 | +}; | ||
2221 | + | ||
2222 | +/************************************************************/ | ||
2223 | +/* */ | ||
2224 | +/* Scrollbar class - JVK */ | ||
2225 | +/* */ | ||
2226 | +/************************************************************/ | ||
2227 | + | ||
2228 | +class GLUIAPI GLUI_Scrollbar : public GLUI_Control | ||
2229 | +{ | ||
2230 | +public: | ||
2231 | + // Constructor, no live var | ||
2232 | + GLUI_Scrollbar( GLUI_Node *parent, | ||
2233 | + const char *name, | ||
2234 | + int horz_vert=GLUI_SCROLL_HORIZONTAL, | ||
2235 | + int data_type=GLUI_SCROLL_INT, | ||
2236 | + int id=-1, GLUI_CB callback=GLUI_CB() | ||
2237 | + /*,GLUI_Control *object = NULL*/ | ||
2238 | + /*,GLUI_InterObject_CB obj_cb = NULL*/ | ||
2239 | + ); | ||
2240 | + | ||
2241 | + // Constructor, int live var | ||
2242 | + GLUI_Scrollbar( GLUI_Node *parent, const char *name, int horz_vert, | ||
2243 | + int *live_var, | ||
2244 | + int id=-1, GLUI_CB callback=GLUI_CB() | ||
2245 | + /*,GLUI_Control *object = NULL*/ | ||
2246 | + /*,GLUI_InterObject_CB obj_cb = NULL*/ | ||
2247 | + ); | ||
2248 | + | ||
2249 | + // Constructor, float live var | ||
2250 | + GLUI_Scrollbar( GLUI_Node *parent, const char *name, int horz_vert, | ||
2251 | + float *live_var, | ||
2252 | + int id=-1, GLUI_CB callback=GLUI_CB() | ||
2253 | + /*,GLUI_Control *object = NULL*/ | ||
2254 | + /*,GLUI_InterObject_CB obj_cb = NULL*/ | ||
2255 | + ); | ||
2256 | + | ||
2257 | + bool currently_inside; | ||
2258 | + int state; | ||
2259 | + float growth, growth_exp; | ||
2260 | + int last_x, last_y; | ||
2261 | + int data_type; | ||
2262 | + int callback_count; | ||
2263 | + int last_int_val; ///< Used to prevent repeated callbacks. | ||
2264 | + float last_float_val; | ||
2265 | + int first_callback; | ||
2266 | + float user_speed; | ||
2267 | + float float_min, float_max; | ||
2268 | + int int_min, int_max; | ||
2269 | + int horizontal; | ||
2270 | + double last_update_time; ///< GLUI_Time() we last advanced scrollbar. | ||
2271 | + double velocity_limit; ///< Maximum distance to advance per second. | ||
2272 | + int box_length; | ||
2273 | + int box_start_position; | ||
2274 | + int box_end_position; | ||
2275 | + int track_length; | ||
2276 | + | ||
2277 | + | ||
2278 | + /* Rather than directly access an Editbox or Textbox for | ||
2279 | + changing variables, a pointer to some object is defined | ||
2280 | + along with a static callback in the form func(void *, int) - | ||
2281 | + the int is the new value, the void * must be cast to that | ||
2282 | + particular object type before use. | ||
2283 | + */ | ||
2284 | + void * associated_object; /* Lets the Spinner manage it's own callbacks */ | ||
2285 | + GLUI_CB object_cb; /* function pointer to object call_back */ | ||
2286 | + | ||
2287 | + int mouse_down_handler( int local_x, int local_y ); | ||
2288 | + int mouse_up_handler( int local_x, int local_y, bool inside ); | ||
2289 | + int mouse_held_down_handler( int local_x, int local_y, bool inside ); | ||
2290 | + int key_handler( unsigned char key,int modifiers ); | ||
2291 | + int special_handler( int key,int modifiers ); | ||
2292 | + | ||
2293 | + void draw( int x, int y ); | ||
2294 | + void draw_pressed( void ); | ||
2295 | + void draw_unpressed( void ); | ||
2296 | + void draw_text( int sunken ); | ||
2297 | + | ||
2298 | + void update_size( void ); | ||
2299 | + | ||
2300 | + void set_int_limits( int low, int high,int limit_type=GLUI_LIMIT_CLAMP); | ||
2301 | + void set_float_limits( float low,float high,int limit_type=GLUI_LIMIT_CLAMP); | ||
2302 | + int find_arrow( int local_x, int local_y ); | ||
2303 | + void do_drag( int x, int y ); | ||
2304 | + void do_callbacks( void ); | ||
2305 | + void draw_scroll( void ); | ||
2306 | + void do_click( void ); | ||
2307 | + void idle( void ); | ||
2308 | + bool needs_idle( void ) const; | ||
2309 | + void set_int_val( int new_val ); | ||
2310 | + void set_float_val( float new_val ); | ||
2311 | + void increase_growth( void ); | ||
2312 | + void reset_growth( void ); | ||
2313 | + | ||
2314 | + void set_speed( float speed ) { user_speed = speed; }; | ||
2315 | + void update_scroll_parameters(); | ||
2316 | + void set_object_callback(GLUI_CB cb=GLUI_CB(), GLUI_Control*obj=NULL) | ||
2317 | + { object_cb=cb; associated_object=obj; } | ||
2318 | + | ||
2319 | +protected: | ||
2320 | + void common_init ( void ); | ||
2321 | + void common_construct( | ||
2322 | + GLUI_Node *parent, | ||
2323 | + const char *name, | ||
2324 | + int horz_vert, | ||
2325 | + int data_type, void* live_var, | ||
2326 | + int id, GLUI_CB callback | ||
2327 | + /*,GLUI_Control *object | ||
2328 | + ,GLUI_InterObject_CB obj_cb*/ | ||
2329 | + ); | ||
2330 | + | ||
2331 | + virtual void draw_scroll_arrow(int arrowtype, int x, int y); | ||
2332 | + virtual void draw_scroll_box(int x, int y, int w, int h); | ||
2333 | +}; | ||
2334 | + | ||
2335 | +/************************************************************/ | ||
2336 | +/* */ | ||
2337 | +/* Listbox class */ | ||
2338 | +/* */ | ||
2339 | +/************************************************************/ | ||
2340 | + | ||
2341 | +class GLUIAPI GLUI_Listbox_Item : public GLUI_Node | ||
2342 | +{ | ||
2343 | +public: | ||
2344 | + GLUI_String text; | ||
2345 | + int id; | ||
2346 | +}; | ||
2347 | + | ||
2348 | +class GLUIAPI GLUI_Listbox : public GLUI_Control | ||
2349 | +{ | ||
2350 | +public: | ||
2351 | + GLUI_String curr_text; | ||
2352 | + GLUI_Listbox_Item items_list; | ||
2353 | + int depressed; | ||
2354 | + | ||
2355 | + int orig_value; | ||
2356 | + bool currently_inside; | ||
2357 | + int text_x_offset, title_x_offset; | ||
2358 | + int glut_menu_id; | ||
2359 | + | ||
2360 | + int mouse_down_handler( int local_x, int local_y ); | ||
2361 | + int mouse_up_handler( int local_x, int local_y, bool inside ); | ||
2362 | + int mouse_held_down_handler( int local_x, int local_y, bool inside ); | ||
2363 | + int key_handler( unsigned char key,int modifiers ); | ||
2364 | + int special_handler( int key,int modifiers ); | ||
2365 | + | ||
2366 | + void update_size( void ); | ||
2367 | + void draw( int x, int y ); | ||
2368 | + int mouse_over( int state, int x, int y ); | ||
2369 | + | ||
2370 | + void set_int_val( int new_val ); | ||
2371 | + void dump( FILE *output ); | ||
2372 | + | ||
2373 | + int add_item( int id, const char *text ); | ||
2374 | + int delete_item( const char *text ); | ||
2375 | + int delete_item( int id ); | ||
2376 | + int sort_items( void ); | ||
2377 | + | ||
2378 | + int do_selection( int item ); | ||
2379 | + | ||
2380 | + GLUI_Listbox_Item *get_item_ptr( const char *text ); | ||
2381 | + GLUI_Listbox_Item *get_item_ptr( int id ); | ||
2382 | + | ||
2383 | + | ||
2384 | + GLUI_Listbox( GLUI_Node *parent, | ||
2385 | + const char *name, int *live_var=NULL, | ||
2386 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
2387 | + GLUI_Listbox( void ) { common_init(); } | ||
2388 | + | ||
2389 | +protected: | ||
2390 | + /** Change w and return true if we need to be widened to fit the current item. */ | ||
2391 | + bool recalculate_item_width( void ); | ||
2392 | + void common_init() { | ||
2393 | + glui_format_str( name, "Listbox: %p", this ); | ||
2394 | + w = GLUI_EDITTEXT_WIDTH; | ||
2395 | + h = GLUI_EDITTEXT_HEIGHT; | ||
2396 | + orig_value = -1; | ||
2397 | + title_x_offset = 0; | ||
2398 | + text_x_offset = 55; | ||
2399 | + can_activate = true; | ||
2400 | + curr_text = ""; | ||
2401 | + live_type = GLUI_LIVE_INT; /* This has an integer live var */ | ||
2402 | + depressed = false; | ||
2403 | + glut_menu_id = -1; | ||
2404 | + } | ||
2405 | + | ||
2406 | + ~GLUI_Listbox(); | ||
2407 | +}; | ||
2408 | + | ||
2409 | +/************************************************************/ | ||
2410 | +/* */ | ||
2411 | +/* Mouse_Interaction class */ | ||
2412 | +/* */ | ||
2413 | +/************************************************************/ | ||
2414 | + | ||
2415 | +/** | ||
2416 | + This is the superclass of translation and rotation widgets. | ||
2417 | +*/ | ||
2418 | +class GLUIAPI GLUI_Mouse_Interaction : public GLUI_Control | ||
2419 | +{ | ||
2420 | +public: | ||
2421 | + /*int get_main_area_size( void ) { return MIN( h-18, */ | ||
2422 | + int draw_active_area_only; | ||
2423 | + | ||
2424 | + int mouse_down_handler( int local_x, int local_y ); | ||
2425 | + int mouse_up_handler( int local_x, int local_y, bool inside ); | ||
2426 | + int mouse_held_down_handler( int local_x, int local_y, bool inside ); | ||
2427 | + int special_handler( int key, int modifiers ); | ||
2428 | + void update_size( void ); | ||
2429 | + void draw( int x, int y ); | ||
2430 | + void draw_active_area( void ); | ||
2431 | + | ||
2432 | + /*** The following methods (starting with "iaction_") need to | ||
2433 | + be overloaded ***/ | ||
2434 | + virtual int iaction_mouse_down_handler( int local_x, int local_y ) = 0; | ||
2435 | + virtual int iaction_mouse_up_handler( int local_x, int local_y, bool inside )=0; | ||
2436 | + virtual int iaction_mouse_held_down_handler( int local_x, int local_y, bool inside )=0; | ||
2437 | + virtual int iaction_special_handler( int key, int modifiers )=0; | ||
2438 | + virtual void iaction_draw_active_area_persp( void )=0; | ||
2439 | + virtual void iaction_draw_active_area_ortho( void )=0; | ||
2440 | + virtual void iaction_dump( FILE *output )=0; | ||
2441 | + virtual void iaction_init( void ) = 0; | ||
2442 | + | ||
2443 | + GLUI_Mouse_Interaction( void ) { | ||
2444 | + glui_format_str( name, "Mouse_Interaction: %p", this ); | ||
2445 | + w = GLUI_MOUSE_INTERACTION_WIDTH; | ||
2446 | + h = GLUI_MOUSE_INTERACTION_HEIGHT; | ||
2447 | + can_activate = true; | ||
2448 | + live_type = GLUI_LIVE_NONE; | ||
2449 | + alignment = GLUI_ALIGN_CENTER; | ||
2450 | + draw_active_area_only = false; | ||
2451 | + } | ||
2452 | +}; | ||
2453 | + | ||
2454 | +/************************************************************/ | ||
2455 | +/* */ | ||
2456 | +/* Rotation class */ | ||
2457 | +/* */ | ||
2458 | +/************************************************************/ | ||
2459 | + | ||
2460 | +/** | ||
2461 | + An onscreen rotation controller--allows the user to interact with | ||
2462 | + a 3D rotation via a spaceball-like interface. | ||
2463 | +*/ | ||
2464 | +class GLUIAPI GLUI_Rotation : public GLUI_Mouse_Interaction | ||
2465 | +{ | ||
2466 | +public: | ||
2467 | + Arcball *ball; | ||
2468 | + GLUquadricObj *quadObj; | ||
2469 | + bool can_spin, spinning; | ||
2470 | + float damping; | ||
2471 | + | ||
2472 | + int iaction_mouse_down_handler( int local_x, int local_y ); | ||
2473 | + int iaction_mouse_up_handler( int local_x, int local_y, bool inside ); | ||
2474 | + int iaction_mouse_held_down_handler( int local_x, int local_y, bool inside ); | ||
2475 | + int iaction_special_handler( int key, int modifiers ); | ||
2476 | + void iaction_init( void ) { init_ball(); } | ||
2477 | + void iaction_draw_active_area_persp( void ); | ||
2478 | + void iaction_draw_active_area_ortho( void ); | ||
2479 | + void iaction_dump( FILE *output ); | ||
2480 | + | ||
2481 | + /* void update_size( void ); */ | ||
2482 | + /* void draw( int x, int y ); */ | ||
2483 | + /* int mouse_over( int state, int x, int y ); */ | ||
2484 | + | ||
2485 | + void setup_texture( void ); | ||
2486 | + void setup_lights( void ); | ||
2487 | + void draw_ball( float radius ); | ||
2488 | + | ||
2489 | + void init_ball( void ); | ||
2490 | + | ||
2491 | + void reset( void ); | ||
2492 | + | ||
2493 | + bool needs_idle( void ) const; | ||
2494 | + void idle( void ); | ||
2495 | + | ||
2496 | + void copy_float_array_to_ball( void ); | ||
2497 | + void copy_ball_to_float_array( void ); | ||
2498 | + | ||
2499 | + void set_spin( float damp_factor ); | ||
2500 | + | ||
2501 | + GLUI_Rotation( GLUI_Node *parent, const char *name, float *live_var=NULL, | ||
2502 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
2503 | + GLUI_Rotation(void) { common_init(); } | ||
2504 | + | ||
2505 | +protected: | ||
2506 | + void common_init(); | ||
2507 | +}; | ||
2508 | + | ||
2509 | +/************************************************************/ | ||
2510 | +/* */ | ||
2511 | +/* Translation class */ | ||
2512 | +/* */ | ||
2513 | +/************************************************************/ | ||
2514 | + | ||
2515 | +/** | ||
2516 | + An onscreen translation controller--allows the user to interact with | ||
2517 | + a 3D translation. | ||
2518 | +*/ | ||
2519 | +class GLUIAPI GLUI_Translation : public GLUI_Mouse_Interaction | ||
2520 | +{ | ||
2521 | +public: | ||
2522 | + int trans_type; /* Is this an XY or a Z controller? */ | ||
2523 | + int down_x, down_y; | ||
2524 | + float scale_factor; | ||
2525 | + GLUquadricObj *quadObj; | ||
2526 | + int trans_mouse_code; | ||
2527 | + float orig_x, orig_y, orig_z; | ||
2528 | + int locked; | ||
2529 | + | ||
2530 | + int iaction_mouse_down_handler( int local_x, int local_y ); | ||
2531 | + int iaction_mouse_up_handler( int local_x, int local_y, bool inside ); | ||
2532 | + int iaction_mouse_held_down_handler( int local_x, int local_y, bool inside ); | ||
2533 | + int iaction_special_handler( int key, int modifiers ); | ||
2534 | + void iaction_init( void ) { } | ||
2535 | + void iaction_draw_active_area_persp( void ); | ||
2536 | + void iaction_draw_active_area_ortho( void ); | ||
2537 | + void iaction_dump( FILE *output ); | ||
2538 | + | ||
2539 | + void set_speed( float s ) { scale_factor = s; } | ||
2540 | + | ||
2541 | + void setup_texture( void ); | ||
2542 | + void setup_lights( void ); | ||
2543 | + void draw_2d_arrow( int radius, int filled, int orientation ); | ||
2544 | + void draw_2d_x_arrows( int radius ); | ||
2545 | + void draw_2d_y_arrows( int radius ); | ||
2546 | + void draw_2d_z_arrows( int radius ); | ||
2547 | + void draw_2d_xy_arrows( int radius ); | ||
2548 | + | ||
2549 | + int get_mouse_code( int x, int y ); | ||
2550 | + | ||
2551 | + /* Float array is either a single float (for single-axis controls), | ||
2552 | + or two floats for X and Y (if an XY controller) */ | ||
2553 | + | ||
2554 | + float get_z( void ) { return float_array_val[0]; } | ||
2555 | + float get_x( void ) { return float_array_val[0]; } | ||
2556 | + float get_y( void ) { | ||
2557 | + if ( trans_type == GLUI_TRANSLATION_XY ) return float_array_val[1]; | ||
2558 | + else return float_array_val[0]; | ||
2559 | + } | ||
2560 | + | ||
2561 | + void set_z( float val ); | ||
2562 | + void set_x( float val ); | ||
2563 | + void set_y( float val ); | ||
2564 | + void set_one_val( float val, int index ); | ||
2565 | + | ||
2566 | + GLUI_Translation( GLUI_Node *parent, const char *name, | ||
2567 | + int trans_type, float *live_var=NULL, | ||
2568 | + int id=-1, GLUI_CB callback=GLUI_CB() ); | ||
2569 | + GLUI_Translation( void ) { common_init(); } | ||
2570 | + | ||
2571 | +protected: | ||
2572 | + void common_init() { | ||
2573 | + locked = GLUI_TRANSLATION_LOCK_NONE; | ||
2574 | + glui_format_str( name, "Translation: %p", this ); | ||
2575 | + w = GLUI_MOUSE_INTERACTION_WIDTH; | ||
2576 | + h = GLUI_MOUSE_INTERACTION_HEIGHT; | ||
2577 | + can_activate = true; | ||
2578 | + live_type = GLUI_LIVE_FLOAT_ARRAY; | ||
2579 | + float_array_size = 0; | ||
2580 | + alignment = GLUI_ALIGN_CENTER; | ||
2581 | + trans_type = GLUI_TRANSLATION_XY; | ||
2582 | + scale_factor = 1.0; | ||
2583 | + quadObj = NULL; | ||
2584 | + trans_mouse_code = GLUI_TRANSLATION_MOUSE_NONE; | ||
2585 | + } | ||
2586 | +}; | ||
2587 | + | ||
2588 | +/********** Misc functions *********************/ | ||
2589 | +int _glutBitmapWidthString( void *font, const char *s ); | ||
2590 | +void _glutBitmapString( void *font, const char *s ); | ||
2591 | + | ||
2592 | +/********** Our own callbacks for glut *********/ | ||
2593 | +/* These are the callbacks that we pass to glut. They take | ||
2594 | + some action if necessary, then (possibly) call the user-level | ||
2595 | + glut callbacks. | ||
2596 | +*/ | ||
2597 | + | ||
2598 | +void glui_display_func( void ); | ||
2599 | +void glui_reshape_func( int w, int h ); | ||
2600 | +void glui_keyboard_func(unsigned char key, int x, int y); | ||
2601 | +void glui_special_func(int key, int x, int y); | ||
2602 | +void glui_mouse_func(int button, int state, int x, int y); | ||
2603 | +void glui_motion_func(int x, int y); | ||
2604 | +void glui_passive_motion_func(int x, int y); | ||
2605 | +void glui_entry_func(int state); | ||
2606 | +void glui_visibility_func(int state); | ||
2607 | +void glui_idle_func(void); | ||
2608 | + | ||
2609 | +void glui_parent_window_reshape_func( int w, int h ); | ||
2610 | +void glui_parent_window_keyboard_func(unsigned char key, int x, int y); | ||
2611 | +void glui_parent_window_mouse_func(int, int, int, int ); | ||
2612 | +void glui_parent_window_special_func(int key, int x, int y); | ||
2613 | + | ||
2614 | +#endif |
gl/glut.h
0 → 100644
1 | +/* Taken from http://www.idfun.de/glut64/ */ | ||
2 | + | ||
3 | +#ifndef __glut_h__ | ||
4 | +#define __glut_h__ | ||
5 | + | ||
6 | +/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */ | ||
7 | + | ||
8 | +/* This program is freely distributable without licensing fees and is | ||
9 | + provided without guarantee or warrantee expressed or implied. This | ||
10 | + program is -not- in the public domain. */ | ||
11 | + | ||
12 | +#if defined(_WIN32) | ||
13 | + | ||
14 | +/* GLUT 3.7 now tries to avoid including <windows.h> | ||
15 | + to avoid name space pollution, but Win32's <GL/gl.h> | ||
16 | + needs APIENTRY and WINGDIAPI defined properly. */ | ||
17 | +# if 0 | ||
18 | + /* This would put tons of macros and crap in our clean name space. */ | ||
19 | +# define WIN32_LEAN_AND_MEAN | ||
20 | +# include <windows.h> | ||
21 | +# else | ||
22 | + /* XXX This is from Win32's <windef.h> */ | ||
23 | +# ifndef APIENTRY | ||
24 | +# define GLUT_APIENTRY_DEFINED | ||
25 | +# if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) || defined(__LCC__) | ||
26 | +# define APIENTRY __stdcall | ||
27 | +# else | ||
28 | +# define APIENTRY | ||
29 | +# endif | ||
30 | +# endif | ||
31 | + /* XXX This is from Win32's <winnt.h> */ | ||
32 | +# ifndef CALLBACK | ||
33 | +# if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) || defined(__LCC__) | ||
34 | +# define CALLBACK __stdcall | ||
35 | +# else | ||
36 | +# define CALLBACK | ||
37 | +# endif | ||
38 | +# endif | ||
39 | + /* XXX Hack for lcc compiler. It doesn't support __declspec(dllimport), just __stdcall. */ | ||
40 | +# if defined( __LCC__ ) | ||
41 | +# undef WINGDIAPI | ||
42 | +# define WINGDIAPI __stdcall | ||
43 | +# else | ||
44 | + /* XXX This is from Win32's <wingdi.h> and <winnt.h> */ | ||
45 | +# ifndef WINGDIAPI | ||
46 | +# define GLUT_WINGDIAPI_DEFINED | ||
47 | +# define WINGDIAPI __declspec(dllimport) | ||
48 | +# endif | ||
49 | +# endif | ||
50 | + /* XXX This is from Win32's <ctype.h> */ | ||
51 | +# ifndef _WCHAR_T_DEFINED | ||
52 | +typedef unsigned short wchar_t; | ||
53 | +# define _WCHAR_T_DEFINED | ||
54 | +# endif | ||
55 | +# endif | ||
56 | + | ||
57 | +/* We do it to avoid confusion between x86 and x64 */ | ||
58 | +#define GLUT_NO_LIB_PRAGMA | ||
59 | + | ||
60 | +/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA | ||
61 | + in your compile preprocessor options. */ | ||
62 | +# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA) | ||
63 | +# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */ | ||
64 | +/* To enable automatic SGI OpenGL for Windows library usage for GLUT, | ||
65 | + define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */ | ||
66 | +# ifdef GLUT_USE_SGI_OPENGL | ||
67 | +# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */ | ||
68 | +# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */ | ||
69 | +# pragma comment (lib, "glut.lib") /* link with Win32 GLUT for SGI OpenGL lib */ | ||
70 | +# else | ||
71 | +# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */ | ||
72 | +# pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */ | ||
73 | +# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */ | ||
74 | +# endif | ||
75 | +# endif | ||
76 | + | ||
77 | +/* To disable supression of annoying warnings about floats being promoted | ||
78 | + to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor | ||
79 | + options. */ | ||
80 | +# ifndef GLUT_NO_WARNING_DISABLE | ||
81 | +# pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */ | ||
82 | +# pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */ | ||
83 | +# endif | ||
84 | + | ||
85 | +/* Win32 has an annoying issue where there are multiple C run-time | ||
86 | + libraries (CRTs). If the executable is linked with a different CRT | ||
87 | + from the GLUT DLL, the GLUT DLL will not share the same CRT static | ||
88 | + data seen by the executable. In particular, atexit callbacks registered | ||
89 | + in the executable will not be called if GLUT calls its (different) | ||
90 | + exit routine). GLUT is typically built with the | ||
91 | + "/MD" option (the CRT with multithreading DLL support), but the Visual | ||
92 | + C++ linker default is "/ML" (the single threaded CRT). | ||
93 | + | ||
94 | + One workaround to this issue is requiring users to always link with | ||
95 | + the same CRT as GLUT is compiled with. That requires users supply a | ||
96 | + non-standard option. GLUT 3.7 has its own built-in workaround where | ||
97 | + the executable's "exit" function pointer is covertly passed to GLUT. | ||
98 | + GLUT then calls the executable's exit function pointer to ensure that | ||
99 | + any "atexit" calls registered by the application are called if GLUT | ||
100 | + needs to exit. | ||
101 | + | ||
102 | + Note that the __glut*WithExit routines should NEVER be called directly. | ||
103 | + To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */ | ||
104 | + | ||
105 | +/* XXX This is from Win32's <process.h> */ | ||
106 | +# if !defined(_MSC_VER) && !defined(__cdecl) | ||
107 | + /* Define __cdecl for non-Microsoft compilers. */ | ||
108 | +# define __cdecl | ||
109 | +# define GLUT_DEFINED___CDECL | ||
110 | +# endif | ||
111 | +# ifndef _CRTIMP | ||
112 | +# ifdef _NTSDK | ||
113 | + /* Definition compatible with NT SDK */ | ||
114 | +# define _CRTIMP | ||
115 | +# else | ||
116 | + /* Current definition */ | ||
117 | +# ifdef _DLL | ||
118 | +# define _CRTIMP __declspec(dllimport) | ||
119 | +# else | ||
120 | +# define _CRTIMP | ||
121 | +# endif | ||
122 | +# endif | ||
123 | +# define GLUT_DEFINED__CRTIMP | ||
124 | +# endif | ||
125 | + | ||
126 | +/* GLUT API entry point declarations for Win32. */ | ||
127 | +# ifdef GLUT_BUILDING_LIB | ||
128 | +# define GLUTAPI __declspec(dllexport) | ||
129 | +# else | ||
130 | +# ifdef _DLL | ||
131 | +# define GLUTAPI __declspec(dllimport) | ||
132 | +# else | ||
133 | +# define GLUTAPI extern | ||
134 | +# endif | ||
135 | +# endif | ||
136 | + | ||
137 | +/* GLUT callback calling convention for Win32. */ | ||
138 | +# define GLUTCALLBACK __cdecl | ||
139 | + | ||
140 | +#endif /* _WIN32 */ | ||
141 | + | ||
142 | +#include <GL/gl.h> | ||
143 | +#include <GL/glu.h> | ||
144 | + | ||
145 | +#ifdef __cplusplus | ||
146 | +extern "C" { | ||
147 | +#endif | ||
148 | + | ||
149 | +#if defined(_WIN32) | ||
150 | +# ifndef GLUT_BUILDING_LIB | ||
151 | +extern _CRTIMP void __cdecl exit(int); | ||
152 | +# endif | ||
153 | +#else | ||
154 | +/* non-Win32 case. */ | ||
155 | +/* Define APIENTRY and CALLBACK to nothing if we aren't on Win32. */ | ||
156 | +# define APIENTRY | ||
157 | +# define GLUT_APIENTRY_DEFINED | ||
158 | +# define CALLBACK | ||
159 | +/* Define GLUTAPI and GLUTCALLBACK as below if we aren't on Win32. */ | ||
160 | +# define GLUTAPI extern | ||
161 | +# define GLUTCALLBACK | ||
162 | +/* Prototype exit for the non-Win32 case (see above). */ | ||
163 | +extern void exit(int); | ||
164 | +#endif | ||
165 | + | ||
166 | +/** | ||
167 | + GLUT API revision history: | ||
168 | + | ||
169 | + GLUT_API_VERSION is updated to reflect incompatible GLUT | ||
170 | + API changes (interface changes, semantic changes, deletions, | ||
171 | + or additions). | ||
172 | + | ||
173 | + GLUT_API_VERSION=1 First public release of GLUT. 11/29/94 | ||
174 | + | ||
175 | + GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling, | ||
176 | + extension. Supports new input devices like tablet, dial and button | ||
177 | + box, and Spaceball. Easy to query OpenGL extensions. | ||
178 | + | ||
179 | + GLUT_API_VERSION=3 glutMenuStatus added. | ||
180 | + | ||
181 | + GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer, | ||
182 | + glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic | ||
183 | + video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc, | ||
184 | + glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat, | ||
185 | + glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!). | ||
186 | +**/ | ||
187 | +#ifndef GLUT_API_VERSION /* allow this to be overriden */ | ||
188 | +#define GLUT_API_VERSION 3 | ||
189 | +#endif | ||
190 | + | ||
191 | +/** | ||
192 | + GLUT implementation revision history: | ||
193 | + | ||
194 | + GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT | ||
195 | + API revisions and implementation revisions (ie, bug fixes). | ||
196 | + | ||
197 | + GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of | ||
198 | + GLUT Xlib-based implementation. 11/29/94 | ||
199 | + | ||
200 | + GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of | ||
201 | + GLUT Xlib-based implementation providing GLUT version 2 | ||
202 | + interfaces. | ||
203 | + | ||
204 | + GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95 | ||
205 | + | ||
206 | + GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95 | ||
207 | + | ||
208 | + GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95 | ||
209 | + | ||
210 | + GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96 | ||
211 | + | ||
212 | + GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner | ||
213 | + and video resize. 1/3/97 | ||
214 | + | ||
215 | + GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines. | ||
216 | + | ||
217 | + GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release. | ||
218 | + | ||
219 | + GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling. | ||
220 | + | ||
221 | + GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support. | ||
222 | + | ||
223 | + GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface. | ||
224 | + | ||
225 | + GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa <GL/glut.h> | ||
226 | +**/ | ||
227 | +#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */ | ||
228 | +#define GLUT_XLIB_IMPLEMENTATION 15 | ||
229 | +#endif | ||
230 | + | ||
231 | +/* Display mode bit masks. */ | ||
232 | +#define GLUT_RGB 0 | ||
233 | +#define GLUT_RGBA GLUT_RGB | ||
234 | +#define GLUT_INDEX 1 | ||
235 | +#define GLUT_SINGLE 0 | ||
236 | +#define GLUT_DOUBLE 2 | ||
237 | +#define GLUT_ACCUM 4 | ||
238 | +#define GLUT_ALPHA 8 | ||
239 | +#define GLUT_DEPTH 16 | ||
240 | +#define GLUT_STENCIL 32 | ||
241 | +#if (GLUT_API_VERSION >= 2) | ||
242 | +#define GLUT_MULTISAMPLE 128 | ||
243 | +#define GLUT_STEREO 256 | ||
244 | +#endif | ||
245 | +#if (GLUT_API_VERSION >= 3) | ||
246 | +#define GLUT_LUMINANCE 512 | ||
247 | +#endif | ||
248 | + | ||
249 | +/* Mouse buttons. */ | ||
250 | +#define GLUT_LEFT_BUTTON 0 | ||
251 | +#define GLUT_MIDDLE_BUTTON 1 | ||
252 | +#define GLUT_RIGHT_BUTTON 2 | ||
253 | + | ||
254 | +/* Mouse button state. */ | ||
255 | +#define GLUT_DOWN 0 | ||
256 | +#define GLUT_UP 1 | ||
257 | + | ||
258 | +#if (GLUT_API_VERSION >= 2) | ||
259 | +/* function keys */ | ||
260 | +#define GLUT_KEY_F1 1 | ||
261 | +#define GLUT_KEY_F2 2 | ||
262 | +#define GLUT_KEY_F3 3 | ||
263 | +#define GLUT_KEY_F4 4 | ||
264 | +#define GLUT_KEY_F5 5 | ||
265 | +#define GLUT_KEY_F6 6 | ||
266 | +#define GLUT_KEY_F7 7 | ||
267 | +#define GLUT_KEY_F8 8 | ||
268 | +#define GLUT_KEY_F9 9 | ||
269 | +#define GLUT_KEY_F10 10 | ||
270 | +#define GLUT_KEY_F11 11 | ||
271 | +#define GLUT_KEY_F12 12 | ||
272 | +/* directional keys */ | ||
273 | +#define GLUT_KEY_LEFT 100 | ||
274 | +#define GLUT_KEY_UP 101 | ||
275 | +#define GLUT_KEY_RIGHT 102 | ||
276 | +#define GLUT_KEY_DOWN 103 | ||
277 | +#define GLUT_KEY_PAGE_UP 104 | ||
278 | +#define GLUT_KEY_PAGE_DOWN 105 | ||
279 | +#define GLUT_KEY_HOME 106 | ||
280 | +#define GLUT_KEY_END 107 | ||
281 | +#define GLUT_KEY_INSERT 108 | ||
282 | +#endif | ||
283 | + | ||
284 | +/* Entry/exit state. */ | ||
285 | +#define GLUT_LEFT 0 | ||
286 | +#define GLUT_ENTERED 1 | ||
287 | + | ||
288 | +/* Menu usage state. */ | ||
289 | +#define GLUT_MENU_NOT_IN_USE 0 | ||
290 | +#define GLUT_MENU_IN_USE 1 | ||
291 | + | ||
292 | +/* Visibility state. */ | ||
293 | +#define GLUT_NOT_VISIBLE 0 | ||
294 | +#define GLUT_VISIBLE 1 | ||
295 | + | ||
296 | +/* Window status state. */ | ||
297 | +#define GLUT_HIDDEN 0 | ||
298 | +#define GLUT_FULLY_RETAINED 1 | ||
299 | +#define GLUT_PARTIALLY_RETAINED 2 | ||
300 | +#define GLUT_FULLY_COVERED 3 | ||
301 | + | ||
302 | +/* Color index component selection values. */ | ||
303 | +#define GLUT_RED 0 | ||
304 | +#define GLUT_GREEN 1 | ||
305 | +#define GLUT_BLUE 2 | ||
306 | + | ||
307 | +#if defined(_WIN32) | ||
308 | +/* Stroke font constants (use these in GLUT program). */ | ||
309 | +#define GLUT_STROKE_ROMAN ((void*)0) | ||
310 | +#define GLUT_STROKE_MONO_ROMAN ((void*)1) | ||
311 | + | ||
312 | +/* Bitmap font constants (use these in GLUT program). */ | ||
313 | +#define GLUT_BITMAP_9_BY_15 ((void*)2) | ||
314 | +#define GLUT_BITMAP_8_BY_13 ((void*)3) | ||
315 | +#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4) | ||
316 | +#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5) | ||
317 | +#if (GLUT_API_VERSION >= 3) | ||
318 | +#define GLUT_BITMAP_HELVETICA_10 ((void*)6) | ||
319 | +#define GLUT_BITMAP_HELVETICA_12 ((void*)7) | ||
320 | +#define GLUT_BITMAP_HELVETICA_18 ((void*)8) | ||
321 | +#endif | ||
322 | +#else | ||
323 | +/* Stroke font opaque addresses (use constants instead in source code). */ | ||
324 | +GLUTAPI void *glutStrokeRoman; | ||
325 | +GLUTAPI void *glutStrokeMonoRoman; | ||
326 | + | ||
327 | +/* Stroke font constants (use these in GLUT program). */ | ||
328 | +#define GLUT_STROKE_ROMAN (&glutStrokeRoman) | ||
329 | +#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman) | ||
330 | + | ||
331 | +/* Bitmap font opaque addresses (use constants instead in source code). */ | ||
332 | +GLUTAPI void *glutBitmap9By15; | ||
333 | +GLUTAPI void *glutBitmap8By13; | ||
334 | +GLUTAPI void *glutBitmapTimesRoman10; | ||
335 | +GLUTAPI void *glutBitmapTimesRoman24; | ||
336 | +GLUTAPI void *glutBitmapHelvetica10; | ||
337 | +GLUTAPI void *glutBitmapHelvetica12; | ||
338 | +GLUTAPI void *glutBitmapHelvetica18; | ||
339 | + | ||
340 | +/* Bitmap font constants (use these in GLUT program). */ | ||
341 | +#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15) | ||
342 | +#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13) | ||
343 | +#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10) | ||
344 | +#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24) | ||
345 | +#if (GLUT_API_VERSION >= 3) | ||
346 | +#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10) | ||
347 | +#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12) | ||
348 | +#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18) | ||
349 | +#endif | ||
350 | +#endif | ||
351 | + | ||
352 | +/* glutGet parameters. */ | ||
353 | +#define GLUT_WINDOW_X ((GLenum) 100) | ||
354 | +#define GLUT_WINDOW_Y ((GLenum) 101) | ||
355 | +#define GLUT_WINDOW_WIDTH ((GLenum) 102) | ||
356 | +#define GLUT_WINDOW_HEIGHT ((GLenum) 103) | ||
357 | +#define GLUT_WINDOW_BUFFER_SIZE ((GLenum) 104) | ||
358 | +#define GLUT_WINDOW_STENCIL_SIZE ((GLenum) 105) | ||
359 | +#define GLUT_WINDOW_DEPTH_SIZE ((GLenum) 106) | ||
360 | +#define GLUT_WINDOW_RED_SIZE ((GLenum) 107) | ||
361 | +#define GLUT_WINDOW_GREEN_SIZE ((GLenum) 108) | ||
362 | +#define GLUT_WINDOW_BLUE_SIZE ((GLenum) 109) | ||
363 | +#define GLUT_WINDOW_ALPHA_SIZE ((GLenum) 110) | ||
364 | +#define GLUT_WINDOW_ACCUM_RED_SIZE ((GLenum) 111) | ||
365 | +#define GLUT_WINDOW_ACCUM_GREEN_SIZE ((GLenum) 112) | ||
366 | +#define GLUT_WINDOW_ACCUM_BLUE_SIZE ((GLenum) 113) | ||
367 | +#define GLUT_WINDOW_ACCUM_ALPHA_SIZE ((GLenum) 114) | ||
368 | +#define GLUT_WINDOW_DOUBLEBUFFER ((GLenum) 115) | ||
369 | +#define GLUT_WINDOW_RGBA ((GLenum) 116) | ||
370 | +#define GLUT_WINDOW_PARENT ((GLenum) 117) | ||
371 | +#define GLUT_WINDOW_NUM_CHILDREN ((GLenum) 118) | ||
372 | +#define GLUT_WINDOW_COLORMAP_SIZE ((GLenum) 119) | ||
373 | +#if (GLUT_API_VERSION >= 2) | ||
374 | +#define GLUT_WINDOW_NUM_SAMPLES ((GLenum) 120) | ||
375 | +#define GLUT_WINDOW_STEREO ((GLenum) 121) | ||
376 | +#endif | ||
377 | +#if (GLUT_API_VERSION >= 3) | ||
378 | +#define GLUT_WINDOW_CURSOR ((GLenum) 122) | ||
379 | +#endif | ||
380 | +#define GLUT_SCREEN_WIDTH ((GLenum) 200) | ||
381 | +#define GLUT_SCREEN_HEIGHT ((GLenum) 201) | ||
382 | +#define GLUT_SCREEN_WIDTH_MM ((GLenum) 202) | ||
383 | +#define GLUT_SCREEN_HEIGHT_MM ((GLenum) 203) | ||
384 | +#define GLUT_MENU_NUM_ITEMS ((GLenum) 300) | ||
385 | +#define GLUT_DISPLAY_MODE_POSSIBLE ((GLenum) 400) | ||
386 | +#define GLUT_INIT_WINDOW_X ((GLenum) 500) | ||
387 | +#define GLUT_INIT_WINDOW_Y ((GLenum) 501) | ||
388 | +#define GLUT_INIT_WINDOW_WIDTH ((GLenum) 502) | ||
389 | +#define GLUT_INIT_WINDOW_HEIGHT ((GLenum) 503) | ||
390 | +#define GLUT_INIT_DISPLAY_MODE ((GLenum) 504) | ||
391 | +#if (GLUT_API_VERSION >= 2) | ||
392 | +#define GLUT_ELAPSED_TIME ((GLenum) 700) | ||
393 | +#endif | ||
394 | +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) | ||
395 | +#define GLUT_WINDOW_FORMAT_ID ((GLenum) 123) | ||
396 | +#endif | ||
397 | + | ||
398 | +#if (GLUT_API_VERSION >= 2) | ||
399 | +/* glutDeviceGet parameters. */ | ||
400 | +#define GLUT_HAS_KEYBOARD ((GLenum) 600) | ||
401 | +#define GLUT_HAS_MOUSE ((GLenum) 601) | ||
402 | +#define GLUT_HAS_SPACEBALL ((GLenum) 602) | ||
403 | +#define GLUT_HAS_DIAL_AND_BUTTON_BOX ((GLenum) 603) | ||
404 | +#define GLUT_HAS_TABLET ((GLenum) 604) | ||
405 | +#define GLUT_NUM_MOUSE_BUTTONS ((GLenum) 605) | ||
406 | +#define GLUT_NUM_SPACEBALL_BUTTONS ((GLenum) 606) | ||
407 | +#define GLUT_NUM_BUTTON_BOX_BUTTONS ((GLenum) 607) | ||
408 | +#define GLUT_NUM_DIALS ((GLenum) 608) | ||
409 | +#define GLUT_NUM_TABLET_BUTTONS ((GLenum) 609) | ||
410 | +#endif | ||
411 | +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) | ||
412 | +#define GLUT_DEVICE_IGNORE_KEY_REPEAT ((GLenum) 610) | ||
413 | +#define GLUT_DEVICE_KEY_REPEAT ((GLenum) 611) | ||
414 | +#define GLUT_HAS_JOYSTICK ((GLenum) 612) | ||
415 | +#define GLUT_OWNS_JOYSTICK ((GLenum) 613) | ||
416 | +#define GLUT_JOYSTICK_BUTTONS ((GLenum) 614) | ||
417 | +#define GLUT_JOYSTICK_AXES ((GLenum) 615) | ||
418 | +#define GLUT_JOYSTICK_POLL_RATE ((GLenum) 616) | ||
419 | +#endif | ||
420 | + | ||
421 | +#if (GLUT_API_VERSION >= 3) | ||
422 | +/* glutLayerGet parameters. */ | ||
423 | +#define GLUT_OVERLAY_POSSIBLE ((GLenum) 800) | ||
424 | +#define GLUT_LAYER_IN_USE ((GLenum) 801) | ||
425 | +#define GLUT_HAS_OVERLAY ((GLenum) 802) | ||
426 | +#define GLUT_TRANSPARENT_INDEX ((GLenum) 803) | ||
427 | +#define GLUT_NORMAL_DAMAGED ((GLenum) 804) | ||
428 | +#define GLUT_OVERLAY_DAMAGED ((GLenum) 805) | ||
429 | + | ||
430 | +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) | ||
431 | +/* glutVideoResizeGet parameters. */ | ||
432 | +#define GLUT_VIDEO_RESIZE_POSSIBLE ((GLenum) 900) | ||
433 | +#define GLUT_VIDEO_RESIZE_IN_USE ((GLenum) 901) | ||
434 | +#define GLUT_VIDEO_RESIZE_X_DELTA ((GLenum) 902) | ||
435 | +#define GLUT_VIDEO_RESIZE_Y_DELTA ((GLenum) 903) | ||
436 | +#define GLUT_VIDEO_RESIZE_WIDTH_DELTA ((GLenum) 904) | ||
437 | +#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA ((GLenum) 905) | ||
438 | +#define GLUT_VIDEO_RESIZE_X ((GLenum) 906) | ||
439 | +#define GLUT_VIDEO_RESIZE_Y ((GLenum) 907) | ||
440 | +#define GLUT_VIDEO_RESIZE_WIDTH ((GLenum) 908) | ||
441 | +#define GLUT_VIDEO_RESIZE_HEIGHT ((GLenum) 909) | ||
442 | +#endif | ||
443 | + | ||
444 | +/* glutUseLayer parameters. */ | ||
445 | +#define GLUT_NORMAL ((GLenum) 0) | ||
446 | +#define GLUT_OVERLAY ((GLenum) 1) | ||
447 | + | ||
448 | +/* glutGetModifiers return mask. */ | ||
449 | +#define GLUT_ACTIVE_SHIFT 1 | ||
450 | +#define GLUT_ACTIVE_CTRL 2 | ||
451 | +#define GLUT_ACTIVE_ALT 4 | ||
452 | + | ||
453 | +/* glutSetCursor parameters. */ | ||
454 | +/* Basic arrows. */ | ||
455 | +#define GLUT_CURSOR_RIGHT_ARROW 0 | ||
456 | +#define GLUT_CURSOR_LEFT_ARROW 1 | ||
457 | +/* Symbolic cursor shapes. */ | ||
458 | +#define GLUT_CURSOR_INFO 2 | ||
459 | +#define GLUT_CURSOR_DESTROY 3 | ||
460 | +#define GLUT_CURSOR_HELP 4 | ||
461 | +#define GLUT_CURSOR_CYCLE 5 | ||
462 | +#define GLUT_CURSOR_SPRAY 6 | ||
463 | +#define GLUT_CURSOR_WAIT 7 | ||
464 | +#define GLUT_CURSOR_TEXT 8 | ||
465 | +#define GLUT_CURSOR_CROSSHAIR 9 | ||
466 | +/* Directional cursors. */ | ||
467 | +#define GLUT_CURSOR_UP_DOWN 10 | ||
468 | +#define GLUT_CURSOR_LEFT_RIGHT 11 | ||
469 | +/* Sizing cursors. */ | ||
470 | +#define GLUT_CURSOR_TOP_SIDE 12 | ||
471 | +#define GLUT_CURSOR_BOTTOM_SIDE 13 | ||
472 | +#define GLUT_CURSOR_LEFT_SIDE 14 | ||
473 | +#define GLUT_CURSOR_RIGHT_SIDE 15 | ||
474 | +#define GLUT_CURSOR_TOP_LEFT_CORNER 16 | ||
475 | +#define GLUT_CURSOR_TOP_RIGHT_CORNER 17 | ||
476 | +#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18 | ||
477 | +#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19 | ||
478 | +/* Inherit from parent window. */ | ||
479 | +#define GLUT_CURSOR_INHERIT 100 | ||
480 | +/* Blank cursor. */ | ||
481 | +#define GLUT_CURSOR_NONE 101 | ||
482 | +/* Fullscreen crosshair (if available). */ | ||
483 | +#define GLUT_CURSOR_FULL_CROSSHAIR 102 | ||
484 | +#endif | ||
485 | + | ||
486 | +/* GLUT initialization sub-API. */ | ||
487 | +GLUTAPI void APIENTRY glutInit(int *argcp, char **argv); | ||
488 | +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) | ||
489 | +GLUTAPI void APIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int)); | ||
490 | +#ifndef GLUT_BUILDING_LIB | ||
491 | +static void APIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); } | ||
492 | +#define glutInit glutInit_ATEXIT_HACK | ||
493 | +#endif | ||
494 | +#endif | ||
495 | +GLUTAPI void APIENTRY glutInitDisplayMode(unsigned int mode); | ||
496 | +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) | ||
497 | +GLUTAPI void APIENTRY glutInitDisplayString(const char *string); | ||
498 | +#endif | ||
499 | +GLUTAPI void APIENTRY glutInitWindowPosition(int x, int y); | ||
500 | +GLUTAPI void APIENTRY glutInitWindowSize(int width, int height); | ||
501 | +GLUTAPI void APIENTRY glutMainLoop(void); | ||
502 | + | ||
503 | +/* GLUT window sub-API. */ | ||
504 | +GLUTAPI int APIENTRY glutCreateWindow(const char *title); | ||
505 | +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) | ||
506 | +GLUTAPI int APIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int)); | ||
507 | +#ifndef GLUT_BUILDING_LIB | ||
508 | +static int APIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); } | ||
509 | +#define glutCreateWindow glutCreateWindow_ATEXIT_HACK | ||
510 | +#endif | ||
511 | +#endif | ||
512 | +GLUTAPI int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height); | ||
513 | +GLUTAPI void APIENTRY glutDestroyWindow(int win); | ||
514 | +GLUTAPI void APIENTRY glutPostRedisplay(void); | ||
515 | +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11) | ||
516 | +GLUTAPI void APIENTRY glutPostWindowRedisplay(int win); | ||
517 | +#endif | ||
518 | +GLUTAPI void APIENTRY glutSwapBuffers(void); | ||
519 | +GLUTAPI int APIENTRY glutGetWindow(void); | ||
520 | +GLUTAPI void APIENTRY glutSetWindow(int win); | ||
521 | +GLUTAPI void APIENTRY glutSetWindowTitle(const char *title); | ||
522 | +GLUTAPI void APIENTRY glutSetIconTitle(const char *title); | ||
523 | +GLUTAPI void APIENTRY glutPositionWindow(int x, int y); | ||
524 | +GLUTAPI void APIENTRY glutReshapeWindow(int width, int height); | ||
525 | +GLUTAPI void APIENTRY glutPopWindow(void); | ||
526 | +GLUTAPI void APIENTRY glutPushWindow(void); | ||
527 | +GLUTAPI void APIENTRY glutIconifyWindow(void); | ||
528 | +GLUTAPI void APIENTRY glutShowWindow(void); | ||
529 | +GLUTAPI void APIENTRY glutHideWindow(void); | ||
530 | +#if (GLUT_API_VERSION >= 3) | ||
531 | +GLUTAPI void APIENTRY glutFullScreen(void); | ||
532 | +GLUTAPI void APIENTRY glutSetCursor(int cursor); | ||
533 | +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) | ||
534 | +GLUTAPI void APIENTRY glutWarpPointer(int x, int y); | ||
535 | +#endif | ||
536 | + | ||
537 | +/* GLUT overlay sub-API. */ | ||
538 | +GLUTAPI void APIENTRY glutEstablishOverlay(void); | ||
539 | +GLUTAPI void APIENTRY glutRemoveOverlay(void); | ||
540 | +GLUTAPI void APIENTRY glutUseLayer(GLenum layer); | ||
541 | +GLUTAPI void APIENTRY glutPostOverlayRedisplay(void); | ||
542 | +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11) | ||
543 | +GLUTAPI void APIENTRY glutPostWindowOverlayRedisplay(int win); | ||
544 | +#endif | ||
545 | +GLUTAPI void APIENTRY glutShowOverlay(void); | ||
546 | +GLUTAPI void APIENTRY glutHideOverlay(void); | ||
547 | +#endif | ||
548 | + | ||
549 | +/* GLUT menu sub-API. */ | ||
550 | +GLUTAPI int APIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int)); | ||
551 | +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) | ||
552 | +GLUTAPI int APIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int)); | ||
553 | +#ifndef GLUT_BUILDING_LIB | ||
554 | +static int APIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); } | ||
555 | +#define glutCreateMenu glutCreateMenu_ATEXIT_HACK | ||
556 | +#endif | ||
557 | +#endif | ||
558 | +GLUTAPI void APIENTRY glutDestroyMenu(int menu); | ||
559 | +GLUTAPI int APIENTRY glutGetMenu(void); | ||
560 | +GLUTAPI void APIENTRY glutSetMenu(int menu); | ||
561 | +GLUTAPI void APIENTRY glutAddMenuEntry(const char *label, int value); | ||
562 | +GLUTAPI void APIENTRY glutAddSubMenu(const char *label, int submenu); | ||
563 | +GLUTAPI void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value); | ||
564 | +GLUTAPI void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu); | ||
565 | +GLUTAPI void APIENTRY glutRemoveMenuItem(int item); | ||
566 | +GLUTAPI void APIENTRY glutAttachMenu(int button); | ||
567 | +GLUTAPI void APIENTRY glutDetachMenu(int button); | ||
568 | + | ||
569 | +/* GLUT window callback sub-API. */ | ||
570 | +GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void)); | ||
571 | +GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height)); | ||
572 | +GLUTAPI void APIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y)); | ||
573 | +GLUTAPI void APIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y)); | ||
574 | +GLUTAPI void APIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y)); | ||
575 | +GLUTAPI void APIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y)); | ||
576 | +GLUTAPI void APIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state)); | ||
577 | +GLUTAPI void APIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state)); | ||
578 | +GLUTAPI void APIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void)); | ||
579 | +GLUTAPI void APIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value); | ||
580 | +GLUTAPI void APIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state)); | ||
581 | +#if (GLUT_API_VERSION >= 2) | ||
582 | +GLUTAPI void APIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y)); | ||
583 | +GLUTAPI void APIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z)); | ||
584 | +GLUTAPI void APIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z)); | ||
585 | +GLUTAPI void APIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state)); | ||
586 | +GLUTAPI void APIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state)); | ||
587 | +GLUTAPI void APIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value)); | ||
588 | +GLUTAPI void APIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y)); | ||
589 | +GLUTAPI void APIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y)); | ||
590 | +#if (GLUT_API_VERSION >= 3) | ||
591 | +GLUTAPI void APIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y)); | ||
592 | +GLUTAPI void APIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void)); | ||
593 | +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) | ||
594 | +GLUTAPI void APIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state)); | ||
595 | +#endif | ||
596 | +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) | ||
597 | +GLUTAPI void APIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y)); | ||
598 | +GLUTAPI void APIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y)); | ||
599 | +GLUTAPI void APIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval); | ||
600 | +#endif | ||
601 | +#endif | ||
602 | +#endif | ||
603 | + | ||
604 | +/* GLUT color index sub-API. */ | ||
605 | +GLUTAPI void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue); | ||
606 | +GLUTAPI GLfloat APIENTRY glutGetColor(int ndx, int component); | ||
607 | +GLUTAPI void APIENTRY glutCopyColormap(int win); | ||
608 | + | ||
609 | +/* GLUT state retrieval sub-API. */ | ||
610 | +GLUTAPI int APIENTRY glutGet(GLenum type); | ||
611 | +GLUTAPI int APIENTRY glutDeviceGet(GLenum type); | ||
612 | +#if (GLUT_API_VERSION >= 2) | ||
613 | +/* GLUT extension support sub-API */ | ||
614 | +GLUTAPI int APIENTRY glutExtensionSupported(const char *name); | ||
615 | +#endif | ||
616 | +#if (GLUT_API_VERSION >= 3) | ||
617 | +GLUTAPI int APIENTRY glutGetModifiers(void); | ||
618 | +GLUTAPI int APIENTRY glutLayerGet(GLenum type); | ||
619 | +#endif | ||
620 | + | ||
621 | +/* GLUT font sub-API */ | ||
622 | +GLUTAPI void APIENTRY glutBitmapCharacter(void *font, int character); | ||
623 | +GLUTAPI int APIENTRY glutBitmapWidth(void *font, int character); | ||
624 | +GLUTAPI void APIENTRY glutStrokeCharacter(void *font, int character); | ||
625 | +GLUTAPI int APIENTRY glutStrokeWidth(void *font, int character); | ||
626 | +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) | ||
627 | +GLUTAPI int APIENTRY glutBitmapLength(void *font, const unsigned char *string); | ||
628 | +GLUTAPI int APIENTRY glutStrokeLength(void *font, const unsigned char *string); | ||
629 | +#endif | ||
630 | + | ||
631 | +/* GLUT pre-built models sub-API */ | ||
632 | +GLUTAPI void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks); | ||
633 | +GLUTAPI void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); | ||
634 | +GLUTAPI void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); | ||
635 | +GLUTAPI void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); | ||
636 | +GLUTAPI void APIENTRY glutWireCube(GLdouble size); | ||
637 | +GLUTAPI void APIENTRY glutSolidCube(GLdouble size); | ||
638 | +GLUTAPI void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); | ||
639 | +GLUTAPI void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); | ||
640 | +GLUTAPI void APIENTRY glutWireDodecahedron(void); | ||
641 | +GLUTAPI void APIENTRY glutSolidDodecahedron(void); | ||
642 | +GLUTAPI void APIENTRY glutWireTeapot(GLdouble size); | ||
643 | +GLUTAPI void APIENTRY glutSolidTeapot(GLdouble size); | ||
644 | +GLUTAPI void APIENTRY glutWireOctahedron(void); | ||
645 | +GLUTAPI void APIENTRY glutSolidOctahedron(void); | ||
646 | +GLUTAPI void APIENTRY glutWireTetrahedron(void); | ||
647 | +GLUTAPI void APIENTRY glutSolidTetrahedron(void); | ||
648 | +GLUTAPI void APIENTRY glutWireIcosahedron(void); | ||
649 | +GLUTAPI void APIENTRY glutSolidIcosahedron(void); | ||
650 | + | ||
651 | +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) | ||
652 | +/* GLUT video resize sub-API. */ | ||
653 | +GLUTAPI int APIENTRY glutVideoResizeGet(GLenum param); | ||
654 | +GLUTAPI void APIENTRY glutSetupVideoResizing(void); | ||
655 | +GLUTAPI void APIENTRY glutStopVideoResizing(void); | ||
656 | +GLUTAPI void APIENTRY glutVideoResize(int x, int y, int width, int height); | ||
657 | +GLUTAPI void APIENTRY glutVideoPan(int x, int y, int width, int height); | ||
658 | + | ||
659 | +/* GLUT debugging sub-API. */ | ||
660 | +GLUTAPI void APIENTRY glutReportErrors(void); | ||
661 | +#endif | ||
662 | + | ||
663 | +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) | ||
664 | +/* GLUT device control sub-API. */ | ||
665 | +/* glutSetKeyRepeat modes. */ | ||
666 | +#define GLUT_KEY_REPEAT_OFF 0 | ||
667 | +#define GLUT_KEY_REPEAT_ON 1 | ||
668 | +#define GLUT_KEY_REPEAT_DEFAULT 2 | ||
669 | + | ||
670 | +/* Joystick button masks. */ | ||
671 | +#define GLUT_JOYSTICK_BUTTON_A 1 | ||
672 | +#define GLUT_JOYSTICK_BUTTON_B 2 | ||
673 | +#define GLUT_JOYSTICK_BUTTON_C 4 | ||
674 | +#define GLUT_JOYSTICK_BUTTON_D 8 | ||
675 | + | ||
676 | +GLUTAPI void APIENTRY glutIgnoreKeyRepeat(int ignore); | ||
677 | +GLUTAPI void APIENTRY glutSetKeyRepeat(int repeatMode); | ||
678 | +GLUTAPI void APIENTRY glutForceJoystickFunc(void); | ||
679 | + | ||
680 | +/* GLUT game mode sub-API. */ | ||
681 | +/* glutGameModeGet. */ | ||
682 | +#define GLUT_GAME_MODE_ACTIVE ((GLenum) 0) | ||
683 | +#define GLUT_GAME_MODE_POSSIBLE ((GLenum) 1) | ||
684 | +#define GLUT_GAME_MODE_WIDTH ((GLenum) 2) | ||
685 | +#define GLUT_GAME_MODE_HEIGHT ((GLenum) 3) | ||
686 | +#define GLUT_GAME_MODE_PIXEL_DEPTH ((GLenum) 4) | ||
687 | +#define GLUT_GAME_MODE_REFRESH_RATE ((GLenum) 5) | ||
688 | +#define GLUT_GAME_MODE_DISPLAY_CHANGED ((GLenum) 6) | ||
689 | + | ||
690 | +GLUTAPI void APIENTRY glutGameModeString(const char *string); | ||
691 | +GLUTAPI int APIENTRY glutEnterGameMode(void); | ||
692 | +GLUTAPI void APIENTRY glutLeaveGameMode(void); | ||
693 | +GLUTAPI int APIENTRY glutGameModeGet(GLenum mode); | ||
694 | +#endif | ||
695 | + | ||
696 | +#ifdef __cplusplus | ||
697 | +} | ||
698 | + | ||
699 | +#endif | ||
700 | + | ||
701 | +#ifdef GLUT_APIENTRY_DEFINED | ||
702 | +# undef GLUT_APIENTRY_DEFINED | ||
703 | +# undef APIENTRY | ||
704 | +#endif | ||
705 | + | ||
706 | +#ifdef GLUT_WINGDIAPI_DEFINED | ||
707 | +# undef GLUT_WINGDIAPI_DEFINED | ||
708 | +# undef WINGDIAPI | ||
709 | +#endif | ||
710 | + | ||
711 | +#ifdef GLUT_DEFINED___CDECL | ||
712 | +# undef GLUT_DEFINED___CDECL | ||
713 | +# undef __cdecl | ||
714 | +#endif | ||
715 | + | ||
716 | +#ifdef GLUT_DEFINED__CRTIMP | ||
717 | +# undef GLUT_DEFINED__CRTIMP | ||
718 | +# undef _CRTIMP | ||
719 | +#endif | ||
720 | + | ||
721 | +#endif /* __glut_h__ */ |
gl/wglext.h
0 → 100644
1 | +#ifndef __wglext_h_ | ||
2 | +#define __wglext_h_ | ||
3 | + | ||
4 | +#ifdef __cplusplus | ||
5 | +extern "C" { | ||
6 | +#endif | ||
7 | + | ||
8 | +/* | ||
9 | +** License Applicability. Except to the extent portions of this file are | ||
10 | +** made subject to an alternative license as permitted in the SGI Free | ||
11 | +** Software License B, Version 1.1 (the "License"), the contents of this | ||
12 | +** file are subject only to the provisions of the License. You may not use | ||
13 | +** this file except in compliance with the License. You may obtain a copy | ||
14 | +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 | ||
15 | +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: | ||
16 | +** | ||
17 | +** http://oss.sgi.com/projects/FreeB | ||
18 | +** | ||
19 | +** Note that, as provided in the License, the Software is distributed on an | ||
20 | +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS | ||
21 | +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND | ||
22 | +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A | ||
23 | +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. | ||
24 | +** | ||
25 | +** Original Code. The Original Code is: OpenGL Sample Implementation, | ||
26 | +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, | ||
27 | +** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. | ||
28 | +** Copyright in any portions created by third parties is as indicated | ||
29 | +** elsewhere herein. All Rights Reserved. | ||
30 | +** | ||
31 | +** Additional Notice Provisions: This software was created using the | ||
32 | +** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has | ||
33 | +** not been independently verified as being compliant with the OpenGL(R) | ||
34 | +** version 1.2.1 Specification. | ||
35 | +*/ | ||
36 | + | ||
37 | +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) | ||
38 | +#define WIN32_LEAN_AND_MEAN 1 | ||
39 | +#include <windows.h> | ||
40 | +#endif | ||
41 | + | ||
42 | +#ifndef APIENTRY | ||
43 | +#define APIENTRY | ||
44 | +#endif | ||
45 | +#ifndef APIENTRYP | ||
46 | +#define APIENTRYP APIENTRY * | ||
47 | +#endif | ||
48 | +#ifndef GLAPI | ||
49 | +#define GLAPI extern | ||
50 | +#endif | ||
51 | + | ||
52 | +/*************************************************************/ | ||
53 | + | ||
54 | +/* Header file version number */ | ||
55 | +/* wglext.h last updated 2005/01/07 */ | ||
56 | +/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ | ||
57 | +#define WGL_WGLEXT_VERSION 6 | ||
58 | + | ||
59 | +#ifndef WGL_ARB_buffer_region | ||
60 | +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 | ||
61 | +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 | ||
62 | +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 | ||
63 | +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 | ||
64 | +#endif | ||
65 | + | ||
66 | +#ifndef WGL_ARB_multisample | ||
67 | +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 | ||
68 | +#define WGL_SAMPLES_ARB 0x2042 | ||
69 | +#endif | ||
70 | + | ||
71 | +#ifndef WGL_ARB_extensions_string | ||
72 | +#endif | ||
73 | + | ||
74 | +#ifndef WGL_ARB_pixel_format | ||
75 | +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 | ||
76 | +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 | ||
77 | +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 | ||
78 | +#define WGL_ACCELERATION_ARB 0x2003 | ||
79 | +#define WGL_NEED_PALETTE_ARB 0x2004 | ||
80 | +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 | ||
81 | +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 | ||
82 | +#define WGL_SWAP_METHOD_ARB 0x2007 | ||
83 | +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 | ||
84 | +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 | ||
85 | +#define WGL_TRANSPARENT_ARB 0x200A | ||
86 | +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 | ||
87 | +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 | ||
88 | +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 | ||
89 | +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A | ||
90 | +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B | ||
91 | +#define WGL_SHARE_DEPTH_ARB 0x200C | ||
92 | +#define WGL_SHARE_STENCIL_ARB 0x200D | ||
93 | +#define WGL_SHARE_ACCUM_ARB 0x200E | ||
94 | +#define WGL_SUPPORT_GDI_ARB 0x200F | ||
95 | +#define WGL_SUPPORT_OPENGL_ARB 0x2010 | ||
96 | +#define WGL_DOUBLE_BUFFER_ARB 0x2011 | ||
97 | +#define WGL_STEREO_ARB 0x2012 | ||
98 | +#define WGL_PIXEL_TYPE_ARB 0x2013 | ||
99 | +#define WGL_COLOR_BITS_ARB 0x2014 | ||
100 | +#define WGL_RED_BITS_ARB 0x2015 | ||
101 | +#define WGL_RED_SHIFT_ARB 0x2016 | ||
102 | +#define WGL_GREEN_BITS_ARB 0x2017 | ||
103 | +#define WGL_GREEN_SHIFT_ARB 0x2018 | ||
104 | +#define WGL_BLUE_BITS_ARB 0x2019 | ||
105 | +#define WGL_BLUE_SHIFT_ARB 0x201A | ||
106 | +#define WGL_ALPHA_BITS_ARB 0x201B | ||
107 | +#define WGL_ALPHA_SHIFT_ARB 0x201C | ||
108 | +#define WGL_ACCUM_BITS_ARB 0x201D | ||
109 | +#define WGL_ACCUM_RED_BITS_ARB 0x201E | ||
110 | +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F | ||
111 | +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 | ||
112 | +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 | ||
113 | +#define WGL_DEPTH_BITS_ARB 0x2022 | ||
114 | +#define WGL_STENCIL_BITS_ARB 0x2023 | ||
115 | +#define WGL_AUX_BUFFERS_ARB 0x2024 | ||
116 | +#define WGL_NO_ACCELERATION_ARB 0x2025 | ||
117 | +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 | ||
118 | +#define WGL_FULL_ACCELERATION_ARB 0x2027 | ||
119 | +#define WGL_SWAP_EXCHANGE_ARB 0x2028 | ||
120 | +#define WGL_SWAP_COPY_ARB 0x2029 | ||
121 | +#define WGL_SWAP_UNDEFINED_ARB 0x202A | ||
122 | +#define WGL_TYPE_RGBA_ARB 0x202B | ||
123 | +#define WGL_TYPE_COLORINDEX_ARB 0x202C | ||
124 | +#endif | ||
125 | + | ||
126 | +#ifndef WGL_ARB_make_current_read | ||
127 | +#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 | ||
128 | +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 | ||
129 | +#endif | ||
130 | + | ||
131 | +#ifndef WGL_ARB_pbuffer | ||
132 | +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D | ||
133 | +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E | ||
134 | +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F | ||
135 | +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 | ||
136 | +#define WGL_PBUFFER_LARGEST_ARB 0x2033 | ||
137 | +#define WGL_PBUFFER_WIDTH_ARB 0x2034 | ||
138 | +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 | ||
139 | +#define WGL_PBUFFER_LOST_ARB 0x2036 | ||
140 | +#endif | ||
141 | + | ||
142 | +#ifndef WGL_ARB_render_texture | ||
143 | +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 | ||
144 | +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 | ||
145 | +#define WGL_TEXTURE_FORMAT_ARB 0x2072 | ||
146 | +#define WGL_TEXTURE_TARGET_ARB 0x2073 | ||
147 | +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 | ||
148 | +#define WGL_TEXTURE_RGB_ARB 0x2075 | ||
149 | +#define WGL_TEXTURE_RGBA_ARB 0x2076 | ||
150 | +#define WGL_NO_TEXTURE_ARB 0x2077 | ||
151 | +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 | ||
152 | +#define WGL_TEXTURE_1D_ARB 0x2079 | ||
153 | +#define WGL_TEXTURE_2D_ARB 0x207A | ||
154 | +#define WGL_MIPMAP_LEVEL_ARB 0x207B | ||
155 | +#define WGL_CUBE_MAP_FACE_ARB 0x207C | ||
156 | +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D | ||
157 | +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E | ||
158 | +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F | ||
159 | +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 | ||
160 | +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 | ||
161 | +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 | ||
162 | +#define WGL_FRONT_LEFT_ARB 0x2083 | ||
163 | +#define WGL_FRONT_RIGHT_ARB 0x2084 | ||
164 | +#define WGL_BACK_LEFT_ARB 0x2085 | ||
165 | +#define WGL_BACK_RIGHT_ARB 0x2086 | ||
166 | +#define WGL_AUX0_ARB 0x2087 | ||
167 | +#define WGL_AUX1_ARB 0x2088 | ||
168 | +#define WGL_AUX2_ARB 0x2089 | ||
169 | +#define WGL_AUX3_ARB 0x208A | ||
170 | +#define WGL_AUX4_ARB 0x208B | ||
171 | +#define WGL_AUX5_ARB 0x208C | ||
172 | +#define WGL_AUX6_ARB 0x208D | ||
173 | +#define WGL_AUX7_ARB 0x208E | ||
174 | +#define WGL_AUX8_ARB 0x208F | ||
175 | +#define WGL_AUX9_ARB 0x2090 | ||
176 | +#endif | ||
177 | + | ||
178 | +#ifndef WGL_ARB_pixel_format_float | ||
179 | +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 | ||
180 | +#endif | ||
181 | + | ||
182 | +#ifndef WGL_EXT_make_current_read | ||
183 | +#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 | ||
184 | +#endif | ||
185 | + | ||
186 | +#ifndef WGL_EXT_pixel_format | ||
187 | +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 | ||
188 | +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 | ||
189 | +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 | ||
190 | +#define WGL_ACCELERATION_EXT 0x2003 | ||
191 | +#define WGL_NEED_PALETTE_EXT 0x2004 | ||
192 | +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 | ||
193 | +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 | ||
194 | +#define WGL_SWAP_METHOD_EXT 0x2007 | ||
195 | +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 | ||
196 | +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 | ||
197 | +#define WGL_TRANSPARENT_EXT 0x200A | ||
198 | +#define WGL_TRANSPARENT_VALUE_EXT 0x200B | ||
199 | +#define WGL_SHARE_DEPTH_EXT 0x200C | ||
200 | +#define WGL_SHARE_STENCIL_EXT 0x200D | ||
201 | +#define WGL_SHARE_ACCUM_EXT 0x200E | ||
202 | +#define WGL_SUPPORT_GDI_EXT 0x200F | ||
203 | +#define WGL_SUPPORT_OPENGL_EXT 0x2010 | ||
204 | +#define WGL_DOUBLE_BUFFER_EXT 0x2011 | ||
205 | +#define WGL_STEREO_EXT 0x2012 | ||
206 | +#define WGL_PIXEL_TYPE_EXT 0x2013 | ||
207 | +#define WGL_COLOR_BITS_EXT 0x2014 | ||
208 | +#define WGL_RED_BITS_EXT 0x2015 | ||
209 | +#define WGL_RED_SHIFT_EXT 0x2016 | ||
210 | +#define WGL_GREEN_BITS_EXT 0x2017 | ||
211 | +#define WGL_GREEN_SHIFT_EXT 0x2018 | ||
212 | +#define WGL_BLUE_BITS_EXT 0x2019 | ||
213 | +#define WGL_BLUE_SHIFT_EXT 0x201A | ||
214 | +#define WGL_ALPHA_BITS_EXT 0x201B | ||
215 | +#define WGL_ALPHA_SHIFT_EXT 0x201C | ||
216 | +#define WGL_ACCUM_BITS_EXT 0x201D | ||
217 | +#define WGL_ACCUM_RED_BITS_EXT 0x201E | ||
218 | +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F | ||
219 | +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 | ||
220 | +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 | ||
221 | +#define WGL_DEPTH_BITS_EXT 0x2022 | ||
222 | +#define WGL_STENCIL_BITS_EXT 0x2023 | ||
223 | +#define WGL_AUX_BUFFERS_EXT 0x2024 | ||
224 | +#define WGL_NO_ACCELERATION_EXT 0x2025 | ||
225 | +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 | ||
226 | +#define WGL_FULL_ACCELERATION_EXT 0x2027 | ||
227 | +#define WGL_SWAP_EXCHANGE_EXT 0x2028 | ||
228 | +#define WGL_SWAP_COPY_EXT 0x2029 | ||
229 | +#define WGL_SWAP_UNDEFINED_EXT 0x202A | ||
230 | +#define WGL_TYPE_RGBA_EXT 0x202B | ||
231 | +#define WGL_TYPE_COLORINDEX_EXT 0x202C | ||
232 | +#endif | ||
233 | + | ||
234 | +#ifndef WGL_EXT_pbuffer | ||
235 | +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D | ||
236 | +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E | ||
237 | +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F | ||
238 | +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 | ||
239 | +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 | ||
240 | +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 | ||
241 | +#define WGL_PBUFFER_LARGEST_EXT 0x2033 | ||
242 | +#define WGL_PBUFFER_WIDTH_EXT 0x2034 | ||
243 | +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 | ||
244 | +#endif | ||
245 | + | ||
246 | +#ifndef WGL_EXT_depth_float | ||
247 | +#define WGL_DEPTH_FLOAT_EXT 0x2040 | ||
248 | +#endif | ||
249 | + | ||
250 | +#ifndef WGL_3DFX_multisample | ||
251 | +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 | ||
252 | +#define WGL_SAMPLES_3DFX 0x2061 | ||
253 | +#endif | ||
254 | + | ||
255 | +#ifndef WGL_EXT_multisample | ||
256 | +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 | ||
257 | +#define WGL_SAMPLES_EXT 0x2042 | ||
258 | +#endif | ||
259 | + | ||
260 | +#ifndef WGL_I3D_digital_video_control | ||
261 | +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 | ||
262 | +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 | ||
263 | +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 | ||
264 | +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 | ||
265 | +#endif | ||
266 | + | ||
267 | +#ifndef WGL_I3D_gamma | ||
268 | +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E | ||
269 | +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F | ||
270 | +#endif | ||
271 | + | ||
272 | +#ifndef WGL_I3D_genlock | ||
273 | +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 | ||
274 | +#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045 | ||
275 | +#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046 | ||
276 | +#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047 | ||
277 | +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 | ||
278 | +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 | ||
279 | +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A | ||
280 | +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B | ||
281 | +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C | ||
282 | +#endif | ||
283 | + | ||
284 | +#ifndef WGL_I3D_image_buffer | ||
285 | +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 | ||
286 | +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 | ||
287 | +#endif | ||
288 | + | ||
289 | +#ifndef WGL_I3D_swap_frame_lock | ||
290 | +#endif | ||
291 | + | ||
292 | +#ifndef WGL_NV_render_depth_texture | ||
293 | +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 | ||
294 | +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 | ||
295 | +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 | ||
296 | +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 | ||
297 | +#define WGL_DEPTH_COMPONENT_NV 0x20A7 | ||
298 | +#endif | ||
299 | + | ||
300 | +#ifndef WGL_NV_render_texture_rectangle | ||
301 | +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 | ||
302 | +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 | ||
303 | +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 | ||
304 | +#endif | ||
305 | + | ||
306 | +#ifndef WGL_ATI_pixel_format_float | ||
307 | +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 | ||
308 | +#define WGL_RGBA_FLOAT_MODE_ATI 0x8820 | ||
309 | +#define WGL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 | ||
310 | +#endif | ||
311 | + | ||
312 | +#ifndef WGL_NV_float_buffer | ||
313 | +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 | ||
314 | +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 | ||
315 | +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 | ||
316 | +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 | ||
317 | +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 | ||
318 | +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 | ||
319 | +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 | ||
320 | +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 | ||
321 | +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 | ||
322 | +#endif | ||
323 | + | ||
324 | +#ifndef WGL_NV_swap_group | ||
325 | +#endif | ||
326 | + | ||
327 | + | ||
328 | +/*************************************************************/ | ||
329 | + | ||
330 | +#ifndef WGL_ARB_pbuffer | ||
331 | +DECLARE_HANDLE(HPBUFFERARB); | ||
332 | +#endif | ||
333 | +#ifndef WGL_EXT_pbuffer | ||
334 | +DECLARE_HANDLE(HPBUFFEREXT); | ||
335 | +#endif | ||
336 | + | ||
337 | +#ifndef WGL_ARB_buffer_region | ||
338 | +#define WGL_ARB_buffer_region 1 | ||
339 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
340 | +extern HANDLE WINAPI wglCreateBufferRegionARB (HDC, int, UINT); | ||
341 | +extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE); | ||
342 | +extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE, int, int, int, int); | ||
343 | +extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE, int, int, int, int, int, int); | ||
344 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
345 | +typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); | ||
346 | +typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); | ||
347 | +typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); | ||
348 | +typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); | ||
349 | +#endif | ||
350 | + | ||
351 | +#ifndef WGL_ARB_multisample | ||
352 | +#define WGL_ARB_multisample 1 | ||
353 | +#endif | ||
354 | + | ||
355 | +#ifndef WGL_ARB_extensions_string | ||
356 | +#define WGL_ARB_extensions_string 1 | ||
357 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
358 | +extern const char * WINAPI wglGetExtensionsStringARB (HDC); | ||
359 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
360 | +typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); | ||
361 | +#endif | ||
362 | + | ||
363 | +#ifndef WGL_ARB_pixel_format | ||
364 | +#define WGL_ARB_pixel_format 1 | ||
365 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
366 | +extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC, int, int, UINT, const int *, int *); | ||
367 | +extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC, int, int, UINT, const int *, FLOAT *); | ||
368 | +extern BOOL WINAPI wglChoosePixelFormatARB (HDC, const int *, const FLOAT *, UINT, int *, UINT *); | ||
369 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
370 | +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); | ||
371 | +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues); | ||
372 | +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); | ||
373 | +#endif | ||
374 | + | ||
375 | +#ifndef WGL_ARB_make_current_read | ||
376 | +#define WGL_ARB_make_current_read 1 | ||
377 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
378 | +extern BOOL WINAPI wglMakeContextCurrentARB (HDC, HDC, HGLRC); | ||
379 | +extern HDC WINAPI wglGetCurrentReadDCARB (void); | ||
380 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
381 | +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); | ||
382 | +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void); | ||
383 | +#endif | ||
384 | + | ||
385 | +#ifndef WGL_ARB_pbuffer | ||
386 | +#define WGL_ARB_pbuffer 1 | ||
387 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
388 | +extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC, int, int, int, const int *); | ||
389 | +extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB); | ||
390 | +extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB, HDC); | ||
391 | +extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB); | ||
392 | +extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB, int, int *); | ||
393 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
394 | +typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); | ||
395 | +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); | ||
396 | +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); | ||
397 | +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); | ||
398 | +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue); | ||
399 | +#endif | ||
400 | + | ||
401 | +#ifndef WGL_ARB_render_texture | ||
402 | +#define WGL_ARB_render_texture 1 | ||
403 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
404 | +extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB, int); | ||
405 | +extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB, int); | ||
406 | +extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB, const int *); | ||
407 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
408 | +typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); | ||
409 | +typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); | ||
410 | +typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList); | ||
411 | +#endif | ||
412 | + | ||
413 | +#ifndef WGL_ARB_pixel_format_float | ||
414 | +#define WGL_ARB_pixel_format_float 1 | ||
415 | +#endif | ||
416 | + | ||
417 | +#ifndef WGL_EXT_display_color_table | ||
418 | +#define WGL_EXT_display_color_table 1 | ||
419 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
420 | +extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort); | ||
421 | +extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *, GLuint); | ||
422 | +extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort); | ||
423 | +extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort); | ||
424 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
425 | +typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); | ||
426 | +typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length); | ||
427 | +typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); | ||
428 | +typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); | ||
429 | +#endif | ||
430 | + | ||
431 | +#ifndef WGL_EXT_extensions_string | ||
432 | +#define WGL_EXT_extensions_string 1 | ||
433 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
434 | +extern const char * WINAPI wglGetExtensionsStringEXT (void); | ||
435 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
436 | +typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); | ||
437 | +#endif | ||
438 | + | ||
439 | +#ifndef WGL_EXT_make_current_read | ||
440 | +#define WGL_EXT_make_current_read 1 | ||
441 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
442 | +extern BOOL WINAPI wglMakeContextCurrentEXT (HDC, HDC, HGLRC); | ||
443 | +extern HDC WINAPI wglGetCurrentReadDCEXT (void); | ||
444 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
445 | +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); | ||
446 | +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void); | ||
447 | +#endif | ||
448 | + | ||
449 | +#ifndef WGL_EXT_pbuffer | ||
450 | +#define WGL_EXT_pbuffer 1 | ||
451 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
452 | +extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC, int, int, int, const int *); | ||
453 | +extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT); | ||
454 | +extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT, HDC); | ||
455 | +extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT); | ||
456 | +extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT, int, int *); | ||
457 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
458 | +typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); | ||
459 | +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); | ||
460 | +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); | ||
461 | +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); | ||
462 | +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue); | ||
463 | +#endif | ||
464 | + | ||
465 | +#ifndef WGL_EXT_pixel_format | ||
466 | +#define WGL_EXT_pixel_format 1 | ||
467 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
468 | +extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC, int, int, UINT, int *, int *); | ||
469 | +extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC, int, int, UINT, int *, FLOAT *); | ||
470 | +extern BOOL WINAPI wglChoosePixelFormatEXT (HDC, const int *, const FLOAT *, UINT, int *, UINT *); | ||
471 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
472 | +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues); | ||
473 | +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues); | ||
474 | +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); | ||
475 | +#endif | ||
476 | + | ||
477 | +#ifndef WGL_EXT_swap_control | ||
478 | +#define WGL_EXT_swap_control 1 | ||
479 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
480 | +extern BOOL WINAPI wglSwapIntervalEXT (int); | ||
481 | +extern int WINAPI wglGetSwapIntervalEXT (void); | ||
482 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
483 | +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); | ||
484 | +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); | ||
485 | +#endif | ||
486 | + | ||
487 | +#ifndef WGL_EXT_depth_float | ||
488 | +#define WGL_EXT_depth_float 1 | ||
489 | +#endif | ||
490 | + | ||
491 | +#ifndef WGL_NV_vertex_array_range | ||
492 | +#define WGL_NV_vertex_array_range 1 | ||
493 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
494 | +extern void* WINAPI wglAllocateMemoryNV (GLsizei, GLfloat, GLfloat, GLfloat); | ||
495 | +extern void WINAPI wglFreeMemoryNV (void *); | ||
496 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
497 | +typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); | ||
498 | +typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); | ||
499 | +#endif | ||
500 | + | ||
501 | +#ifndef WGL_3DFX_multisample | ||
502 | +#define WGL_3DFX_multisample 1 | ||
503 | +#endif | ||
504 | + | ||
505 | +#ifndef WGL_EXT_multisample | ||
506 | +#define WGL_EXT_multisample 1 | ||
507 | +#endif | ||
508 | + | ||
509 | +#ifndef WGL_OML_sync_control | ||
510 | +#define WGL_OML_sync_control 1 | ||
511 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
512 | +extern BOOL WINAPI wglGetSyncValuesOML (HDC, INT64 *, INT64 *, INT64 *); | ||
513 | +extern BOOL WINAPI wglGetMscRateOML (HDC, INT32 *, INT32 *); | ||
514 | +extern INT64 WINAPI wglSwapBuffersMscOML (HDC, INT64, INT64, INT64); | ||
515 | +extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC, int, INT64, INT64, INT64); | ||
516 | +extern BOOL WINAPI wglWaitForMscOML (HDC, INT64, INT64, INT64, INT64 *, INT64 *, INT64 *); | ||
517 | +extern BOOL WINAPI wglWaitForSbcOML (HDC, INT64, INT64 *, INT64 *, INT64 *); | ||
518 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
519 | +typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc); | ||
520 | +typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator); | ||
521 | +typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); | ||
522 | +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); | ||
523 | +typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc); | ||
524 | +typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc); | ||
525 | +#endif | ||
526 | + | ||
527 | +#ifndef WGL_I3D_digital_video_control | ||
528 | +#define WGL_I3D_digital_video_control 1 | ||
529 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
530 | +extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC, int, int *); | ||
531 | +extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC, int, const int *); | ||
532 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
533 | +typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue); | ||
534 | +typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue); | ||
535 | +#endif | ||
536 | + | ||
537 | +#ifndef WGL_I3D_gamma | ||
538 | +#define WGL_I3D_gamma 1 | ||
539 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
540 | +extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC, int, int *); | ||
541 | +extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC, int, const int *); | ||
542 | +extern BOOL WINAPI wglGetGammaTableI3D (HDC, int, USHORT *, USHORT *, USHORT *); | ||
543 | +extern BOOL WINAPI wglSetGammaTableI3D (HDC, int, const USHORT *, const USHORT *, const USHORT *); | ||
544 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
545 | +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue); | ||
546 | +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue); | ||
547 | +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue); | ||
548 | +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue); | ||
549 | +#endif | ||
550 | + | ||
551 | +#ifndef WGL_I3D_genlock | ||
552 | +#define WGL_I3D_genlock 1 | ||
553 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
554 | +extern BOOL WINAPI wglEnableGenlockI3D (HDC); | ||
555 | +extern BOOL WINAPI wglDisableGenlockI3D (HDC); | ||
556 | +extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC, BOOL *); | ||
557 | +extern BOOL WINAPI wglGenlockSourceI3D (HDC, UINT); | ||
558 | +extern BOOL WINAPI wglGetGenlockSourceI3D (HDC, UINT *); | ||
559 | +extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC, UINT); | ||
560 | +extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC, UINT *); | ||
561 | +extern BOOL WINAPI wglGenlockSampleRateI3D (HDC, UINT); | ||
562 | +extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC, UINT *); | ||
563 | +extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC, UINT); | ||
564 | +extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC, UINT *); | ||
565 | +extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC, UINT *, UINT *); | ||
566 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
567 | +typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); | ||
568 | +typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); | ||
569 | +typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag); | ||
570 | +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); | ||
571 | +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource); | ||
572 | +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); | ||
573 | +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge); | ||
574 | +typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); | ||
575 | +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate); | ||
576 | +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); | ||
577 | +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay); | ||
578 | +typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay); | ||
579 | +#endif | ||
580 | + | ||
581 | +#ifndef WGL_I3D_image_buffer | ||
582 | +#define WGL_I3D_image_buffer 1 | ||
583 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
584 | +extern LPVOID WINAPI wglCreateImageBufferI3D (HDC, DWORD, UINT); | ||
585 | +extern BOOL WINAPI wglDestroyImageBufferI3D (HDC, LPVOID); | ||
586 | +extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC, const HANDLE *, const LPVOID *, const DWORD *, UINT); | ||
587 | +extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC, const LPVOID *, UINT); | ||
588 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
589 | +typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); | ||
590 | +typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); | ||
591 | +typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count); | ||
592 | +typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count); | ||
593 | +#endif | ||
594 | + | ||
595 | +#ifndef WGL_I3D_swap_frame_lock | ||
596 | +#define WGL_I3D_swap_frame_lock 1 | ||
597 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
598 | +extern BOOL WINAPI wglEnableFrameLockI3D (void); | ||
599 | +extern BOOL WINAPI wglDisableFrameLockI3D (void); | ||
600 | +extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *); | ||
601 | +extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *); | ||
602 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
603 | +typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void); | ||
604 | +typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void); | ||
605 | +typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag); | ||
606 | +typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag); | ||
607 | +#endif | ||
608 | + | ||
609 | +#ifndef WGL_I3D_swap_frame_usage | ||
610 | +#define WGL_I3D_swap_frame_usage 1 | ||
611 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
612 | +extern BOOL WINAPI wglGetFrameUsageI3D (float *); | ||
613 | +extern BOOL WINAPI wglBeginFrameTrackingI3D (void); | ||
614 | +extern BOOL WINAPI wglEndFrameTrackingI3D (void); | ||
615 | +extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *, DWORD *, float *); | ||
616 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
617 | +typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage); | ||
618 | +typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); | ||
619 | +typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); | ||
620 | +typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); | ||
621 | +#endif | ||
622 | + | ||
623 | +#ifndef WGL_ATI_pixel_format_float | ||
624 | +#define WGL_ATI_pixel_format_float 1 | ||
625 | +#endif | ||
626 | + | ||
627 | +#ifndef WGL_NV_render_depth_texture | ||
628 | +#define WGL_NV_render_depth_texture 1 | ||
629 | +#endif | ||
630 | + | ||
631 | +#ifndef WGL_NV_render_texture_rectangle | ||
632 | +#define WGL_NV_render_texture_rectangle 1 | ||
633 | +#endif | ||
634 | + | ||
635 | +#ifndef WGL_NV_float_buffer | ||
636 | +#define WGL_NV_float_buffer 1 | ||
637 | +#endif | ||
638 | + | ||
639 | +#ifndef WGL_NV_swap_group | ||
640 | +#define WGL_NV_swap_group 1 | ||
641 | +#ifdef WGL_WGLEXT_PROTOTYPES | ||
642 | +extern BOOL WINAPI wglJoinSwapGroupNV(HDC hDC, GLuint group); | ||
643 | +extern BOOL WINAPI wglBindSwapBarrierNV(GLuint group, GLuint barrier); | ||
644 | +extern BOOL WINAPI wglQuerySwapGroupNV(HDC hDC GLuint *group, GLuint *barrier); | ||
645 | +extern BOOL WINAPI wglQueryMaxSwapGroupsNV(HDC hDC, GLuint *maxGroups, GLuint *maxBarriers); | ||
646 | +extern BOOL WINAPI wglQueryFrameCountNV(HDC hDC, GLuint *count); | ||
647 | +extern BOOL WINAPI wglResetFrameCountNV(HDC hDC); | ||
648 | +#endif /* WGL_WGLEXT_PROTOTYPES */ | ||
649 | +typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); | ||
650 | +typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); | ||
651 | +typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier); | ||
652 | +typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers); | ||
653 | +typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count); | ||
654 | +typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); | ||
655 | +#endif | ||
656 | + | ||
657 | + | ||
658 | +#ifdef __cplusplus | ||
659 | +} | ||
660 | +#endif | ||
661 | + | ||
662 | +#endif |
lib/freeglut/Copying.txt
0 → 100644
1 | + | ||
2 | + Freeglut Copyright | ||
3 | + ------------------ | ||
4 | + | ||
5 | + Freeglut code without an explicit copyright is covered by the following | ||
6 | + copyright: | ||
7 | + | ||
8 | + Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. | ||
9 | + Permission is hereby granted, free of charge, to any person obtaining a copy | ||
10 | + of this software and associated documentation files (the "Software"), to deal | ||
11 | + in the Software without restriction, including without limitation the rights | ||
12 | + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
13 | + copies or substantial portions of the Software. | ||
14 | + | ||
15 | + The above copyright notice and this permission notice shall be included in | ||
16 | + all copies or substantial portions of the Software. | ||
17 | + | ||
18 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
19 | + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
20 | + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
21 | + PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
22 | + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
23 | + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
24 | + | ||
25 | + Except as contained in this notice, the name of Pawel W. Olszta shall not be | ||
26 | + used in advertising or otherwise to promote the sale, use or other dealings | ||
27 | + in this Software without prior written authorization from Pawel W. Olszta. |
lib/freeglut/Readme.txt
0 → 100644
1 | +freeglut 2.8.1-1.mp for MSVC | ||
2 | + | ||
3 | +This package contains freeglut import libraries, headers, and Windows DLLs. | ||
4 | +These allow 32 and 64 bit GLUT applications to be compiled on Windows using | ||
5 | +Microsoft Visual C++. | ||
6 | + | ||
7 | +For more information on freeglut, visit http://freeglut.sourceforge.net/. | ||
8 | + | ||
9 | + | ||
10 | +Installation | ||
11 | + | ||
12 | +Create a folder on your PC which is readable by all users, for example | ||
13 | +“C:\Program Files\Common Files\MSVC\freeglut\” on a typical Windows system. Copy | ||
14 | +the “lib\” and “include\” folders from this zip archive to that location. | ||
15 | + | ||
16 | +The appropriate freeglut DLL can either be placed in the same folder as your | ||
17 | +application, or can be installed in a system-wide folder which appears in your | ||
18 | +%PATH% environment variable. Be careful not to mix the 32 bit DLL up with the 64 | ||
19 | +bit DLL, as they are not interchangeable. | ||
20 | + | ||
21 | + | ||
22 | +Compiling 32 bit Applications | ||
23 | + | ||
24 | +To create a 32 bit freeglut application, create a new Win32 C++ project in MSVC. | ||
25 | +From the “Win32 Application Wizard”, choose a “Windows application”, check the | ||
26 | +“Empty project” box, and submit. | ||
27 | + | ||
28 | +You’ll now need to configure the compiler and linker settings. Open up the | ||
29 | +project properties, and select “All Configurations” (this is necessary to ensure | ||
30 | +our changes are applied for both debug and release builds). Open up the | ||
31 | +“general” section under “C/C++”, and configure the “include\” folder you created | ||
32 | +above as an “Additional Include Directory”. If you have more than one GLUT | ||
33 | +package which contains a “glut.h” file, it’s important to ensure that the | ||
34 | +freeglut include folder appears above all other GLUT include folders. | ||
35 | + | ||
36 | +Now open up the “general” section under “Linker”, and configure the “lib\” | ||
37 | +folder you created above as an “Additional Library Directory”. A freeglut | ||
38 | +application depends on the import libraries “freeglut.lib” and “opengl32.lib”, | ||
39 | +which can be configured under the “Input” section. However, it shouldn’t be | ||
40 | +necessary to explicitly state these dependencies, since the freeglut headers | ||
41 | +handle this for you. Now open the “Advanced” section, and enter “mainCRTStartup” | ||
42 | +as the “Entry Point” for your application. This is necessary because GLUT | ||
43 | +applications use “main” as the application entry point, not “WinMain”—without it | ||
44 | +you’ll get an undefined reference when you try to link your application. | ||
45 | + | ||
46 | +That’s all of your project properties configured, so you can now add source | ||
47 | +files to your project and build the application. If you want your application to | ||
48 | +be compatible with GLUT, you should “#include <GL/glut.h>”. If you want to use | ||
49 | +freeglut specific extensions, you should “#include <GL/freeglut.h>” instead. | ||
50 | + | ||
51 | +Don’t forget to either include the freeglut DLL when distributing applications, | ||
52 | +or provide your users with some method of obtaining it if they don’t already | ||
53 | +have it! | ||
54 | + | ||
55 | + | ||
56 | +Compiling 64 bit Applications | ||
57 | + | ||
58 | +Building 64 bit applications is almost identical to building 32 bit applications. | ||
59 | +When you use the configuration manager to add the x64 platform, it’s easiest to | ||
60 | +copy the settings from the Win32 platform. If you do so, it’s then only necessary | ||
61 | +to change the “Additional Library Directories” configuration so that it | ||
62 | +references the directory containing the 64 bit import library rather | ||
63 | +than the 32 bit one. | ||
64 | + | ||
65 | + | ||
66 | +Problems? | ||
67 | + | ||
68 | +If you have problems using this package (compiler / linker errors etc.), please | ||
69 | +check that you have followed all of the steps in this readme file correctly. | ||
70 | +Almost all of the problems which are reported with these packages are due to | ||
71 | +missing a step or not doing it correctly, for example trying to build a 32 bit | ||
72 | +app against the 64 bit import library. If you have followed all of the steps | ||
73 | +correctly but your application still fails to build, try building a very simple | ||
74 | +but functional program (the example at | ||
75 | +http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/ works fine | ||
76 | +with MSVC). A lot of people try to build very complex applications after | ||
77 | +installing these packages, and often the error is with the application code or | ||
78 | +other library dependencies rather than freeglut. | ||
79 | + | ||
80 | +If you still can’t get it working after trying to compile a simple application, | ||
81 | +then please get in touch via http://www.transmissionzero.co.uk/contact/, | ||
82 | +providing as much detail as you can. Please don’t complain to the freeglut guys | ||
83 | +unless you’re sure it’s a freeglut bug, and have reproduced the issue after | ||
84 | +compiling freeglut from the latest SVN version—if that’s still the case, I’m sure | ||
85 | +they would appreciate a bug report or a patch. | ||
86 | + | ||
87 | + | ||
88 | +Changelog | ||
89 | + | ||
90 | +2013–05–11: Release 2.8.1-1.mp | ||
91 | + | ||
92 | + • First 2.8.1 MSVC release. I’ve built the package using Visual Studio 2012, | ||
93 | + and the only change I’ve made is to the DLL version resource—I’ve changed | ||
94 | + the description so that my MinGW and MSVC builds are distinguishable from | ||
95 | + each other (and other builds) using Windows Explorer. | ||
96 | + | ||
97 | + | ||
98 | +Martin Payne | ||
99 | +2013–05–11 | ||
100 | + | ||
101 | +http://www.transmissionzero.co.uk/ |
lib/freeglut/bin/freeglut.dll
0 → 100644
No preview for this file type
lib/freeglut/bin/x64/freeglut.dll
0 → 100644
No preview for this file type
lib/freeglut/include/GL/freeglut.h
0 → 100644
1 | +#ifndef __FREEGLUT_H__ | ||
2 | +#define __FREEGLUT_H__ | ||
3 | + | ||
4 | +/* | ||
5 | + * freeglut.h | ||
6 | + * | ||
7 | + * The freeglut library include file | ||
8 | + * | ||
9 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
10 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
11 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
12 | + * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
13 | + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
14 | + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
15 | + */ | ||
16 | + | ||
17 | +#include "freeglut_std.h" | ||
18 | +#include "freeglut_ext.h" | ||
19 | + | ||
20 | +/*** END OF FILE ***/ | ||
21 | + | ||
22 | +#endif /* __FREEGLUT_H__ */ |
lib/freeglut/include/GL/freeglut_ext.h
0 → 100644
1 | +#ifndef __FREEGLUT_EXT_H__ | ||
2 | +#define __FREEGLUT_EXT_H__ | ||
3 | + | ||
4 | +/* | ||
5 | + * freeglut_ext.h | ||
6 | + * | ||
7 | + * The non-GLUT-compatible extensions to the freeglut library include file | ||
8 | + * | ||
9 | + * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. | ||
10 | + * Written by Pawel W. Olszta, <olszta@sourceforge.net> | ||
11 | + * Creation date: Thu Dec 2 1999 | ||
12 | + * | ||
13 | + * Permission is hereby granted, free of charge, to any person obtaining a | ||
14 | + * copy of this software and associated documentation files (the "Software"), | ||
15 | + * to deal in the Software without restriction, including without limitation | ||
16 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
17 | + * and/or sell copies of the Software, and to permit persons to whom the | ||
18 | + * Software is furnished to do so, subject to the following conditions: | ||
19 | + * | ||
20 | + * The above copyright notice and this permission notice shall be included | ||
21 | + * in all copies or substantial portions of the Software. | ||
22 | + * | ||
23 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
24 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
25 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
26 | + * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
27 | + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
28 | + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
29 | + */ | ||
30 | + | ||
31 | +#ifdef __cplusplus | ||
32 | + extern "C" { | ||
33 | +#endif | ||
34 | + | ||
35 | +/* | ||
36 | + * Additional GLUT Key definitions for the Special key function | ||
37 | + */ | ||
38 | +#define GLUT_KEY_NUM_LOCK 0x006D | ||
39 | +#define GLUT_KEY_BEGIN 0x006E | ||
40 | +#define GLUT_KEY_DELETE 0x006F | ||
41 | +#define GLUT_KEY_SHIFT_L 0x0070 | ||
42 | +#define GLUT_KEY_SHIFT_R 0x0071 | ||
43 | +#define GLUT_KEY_CTRL_L 0x0072 | ||
44 | +#define GLUT_KEY_CTRL_R 0x0073 | ||
45 | +#define GLUT_KEY_ALT_L 0x0074 | ||
46 | +#define GLUT_KEY_ALT_R 0x0075 | ||
47 | + | ||
48 | +/* | ||
49 | + * GLUT API Extension macro definitions -- behaviour when the user clicks on an "x" to close a window | ||
50 | + */ | ||
51 | +#define GLUT_ACTION_EXIT 0 | ||
52 | +#define GLUT_ACTION_GLUTMAINLOOP_RETURNS 1 | ||
53 | +#define GLUT_ACTION_CONTINUE_EXECUTION 2 | ||
54 | + | ||
55 | +/* | ||
56 | + * Create a new rendering context when the user opens a new window? | ||
57 | + */ | ||
58 | +#define GLUT_CREATE_NEW_CONTEXT 0 | ||
59 | +#define GLUT_USE_CURRENT_CONTEXT 1 | ||
60 | + | ||
61 | +/* | ||
62 | + * Direct/Indirect rendering context options (has meaning only in Unix/X11) | ||
63 | + */ | ||
64 | +#define GLUT_FORCE_INDIRECT_CONTEXT 0 | ||
65 | +#define GLUT_ALLOW_DIRECT_CONTEXT 1 | ||
66 | +#define GLUT_TRY_DIRECT_CONTEXT 2 | ||
67 | +#define GLUT_FORCE_DIRECT_CONTEXT 3 | ||
68 | + | ||
69 | +/* | ||
70 | + * GLUT API Extension macro definitions -- the glutGet parameters | ||
71 | + */ | ||
72 | +#define GLUT_INIT_STATE 0x007C | ||
73 | + | ||
74 | +#define GLUT_ACTION_ON_WINDOW_CLOSE 0x01F9 | ||
75 | + | ||
76 | +#define GLUT_WINDOW_BORDER_WIDTH 0x01FA | ||
77 | +#define GLUT_WINDOW_BORDER_HEIGHT 0x01FB | ||
78 | +#define GLUT_WINDOW_HEADER_HEIGHT 0x01FB /* Docs say it should always have been GLUT_WINDOW_BORDER_HEIGHT, keep this for backward compatibility */ | ||
79 | + | ||
80 | +#define GLUT_VERSION 0x01FC | ||
81 | + | ||
82 | +#define GLUT_RENDERING_CONTEXT 0x01FD | ||
83 | +#define GLUT_DIRECT_RENDERING 0x01FE | ||
84 | + | ||
85 | +#define GLUT_FULL_SCREEN 0x01FF | ||
86 | + | ||
87 | +#define GLUT_SKIP_STALE_MOTION_EVENTS 0x0204 | ||
88 | + | ||
89 | +/* | ||
90 | + * New tokens for glutInitDisplayMode. | ||
91 | + * Only one GLUT_AUXn bit may be used at a time. | ||
92 | + * Value 0x0400 is defined in OpenGLUT. | ||
93 | + */ | ||
94 | +#define GLUT_AUX 0x1000 | ||
95 | + | ||
96 | +#define GLUT_AUX1 0x1000 | ||
97 | +#define GLUT_AUX2 0x2000 | ||
98 | +#define GLUT_AUX3 0x4000 | ||
99 | +#define GLUT_AUX4 0x8000 | ||
100 | + | ||
101 | +/* | ||
102 | + * Context-related flags, see freeglut_state.c | ||
103 | + */ | ||
104 | +#define GLUT_INIT_MAJOR_VERSION 0x0200 | ||
105 | +#define GLUT_INIT_MINOR_VERSION 0x0201 | ||
106 | +#define GLUT_INIT_FLAGS 0x0202 | ||
107 | +#define GLUT_INIT_PROFILE 0x0203 | ||
108 | + | ||
109 | +/* | ||
110 | + * Flags for glutInitContextFlags, see freeglut_init.c | ||
111 | + */ | ||
112 | +#define GLUT_DEBUG 0x0001 | ||
113 | +#define GLUT_FORWARD_COMPATIBLE 0x0002 | ||
114 | + | ||
115 | + | ||
116 | +/* | ||
117 | + * Flags for glutInitContextProfile, see freeglut_init.c | ||
118 | + */ | ||
119 | +#define GLUT_CORE_PROFILE 0x0001 | ||
120 | +#define GLUT_COMPATIBILITY_PROFILE 0x0002 | ||
121 | + | ||
122 | +/* | ||
123 | + * Process loop function, see freeglut_main.c | ||
124 | + */ | ||
125 | +FGAPI void FGAPIENTRY glutMainLoopEvent( void ); | ||
126 | +FGAPI void FGAPIENTRY glutLeaveMainLoop( void ); | ||
127 | +FGAPI void FGAPIENTRY glutExit ( void ); | ||
128 | + | ||
129 | +/* | ||
130 | + * Window management functions, see freeglut_window.c | ||
131 | + */ | ||
132 | +FGAPI void FGAPIENTRY glutFullScreenToggle( void ); | ||
133 | +FGAPI void FGAPIENTRY glutLeaveFullScreen( void ); | ||
134 | + | ||
135 | +/* | ||
136 | + * Window-specific callback functions, see freeglut_callbacks.c | ||
137 | + */ | ||
138 | +FGAPI void FGAPIENTRY glutMouseWheelFunc( void (* callback)( int, int, int, int ) ); | ||
139 | +FGAPI void FGAPIENTRY glutCloseFunc( void (* callback)( void ) ); | ||
140 | +FGAPI void FGAPIENTRY glutWMCloseFunc( void (* callback)( void ) ); | ||
141 | +/* A. Donev: Also a destruction callback for menus */ | ||
142 | +FGAPI void FGAPIENTRY glutMenuDestroyFunc( void (* callback)( void ) ); | ||
143 | + | ||
144 | +/* | ||
145 | + * State setting and retrieval functions, see freeglut_state.c | ||
146 | + */ | ||
147 | +FGAPI void FGAPIENTRY glutSetOption ( GLenum option_flag, int value ); | ||
148 | +FGAPI int * FGAPIENTRY glutGetModeValues(GLenum mode, int * size); | ||
149 | +/* A.Donev: User-data manipulation */ | ||
150 | +FGAPI void* FGAPIENTRY glutGetWindowData( void ); | ||
151 | +FGAPI void FGAPIENTRY glutSetWindowData(void* data); | ||
152 | +FGAPI void* FGAPIENTRY glutGetMenuData( void ); | ||
153 | +FGAPI void FGAPIENTRY glutSetMenuData(void* data); | ||
154 | + | ||
155 | +/* | ||
156 | + * Font stuff, see freeglut_font.c | ||
157 | + */ | ||
158 | +FGAPI int FGAPIENTRY glutBitmapHeight( void* font ); | ||
159 | +FGAPI GLfloat FGAPIENTRY glutStrokeHeight( void* font ); | ||
160 | +FGAPI void FGAPIENTRY glutBitmapString( void* font, const unsigned char *string ); | ||
161 | +FGAPI void FGAPIENTRY glutStrokeString( void* font, const unsigned char *string ); | ||
162 | + | ||
163 | +/* | ||
164 | + * Geometry functions, see freeglut_geometry.c | ||
165 | + */ | ||
166 | +FGAPI void FGAPIENTRY glutWireRhombicDodecahedron( void ); | ||
167 | +FGAPI void FGAPIENTRY glutSolidRhombicDodecahedron( void ); | ||
168 | +FGAPI void FGAPIENTRY glutWireSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale ); | ||
169 | +FGAPI void FGAPIENTRY glutSolidSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale ); | ||
170 | +FGAPI void FGAPIENTRY glutWireCylinder( GLdouble radius, GLdouble height, GLint slices, GLint stacks); | ||
171 | +FGAPI void FGAPIENTRY glutSolidCylinder( GLdouble radius, GLdouble height, GLint slices, GLint stacks); | ||
172 | + | ||
173 | +/* | ||
174 | + * Extension functions, see freeglut_ext.c | ||
175 | + */ | ||
176 | +typedef void (*GLUTproc)(); | ||
177 | +FGAPI GLUTproc FGAPIENTRY glutGetProcAddress( const char *procName ); | ||
178 | + | ||
179 | +/* | ||
180 | + * Multi-touch/multi-pointer extensions | ||
181 | + */ | ||
182 | + | ||
183 | +#define GLUT_HAS_MULTI 1 | ||
184 | + | ||
185 | +FGAPI void FGAPIENTRY glutMultiEntryFunc( void (* callback)( int, int ) ); | ||
186 | +FGAPI void FGAPIENTRY glutMultiButtonFunc( void (* callback)( int, int, int, int, int ) ); | ||
187 | +FGAPI void FGAPIENTRY glutMultiMotionFunc( void (* callback)( int, int, int ) ); | ||
188 | +FGAPI void FGAPIENTRY glutMultiPassiveFunc( void (* callback)( int, int, int ) ); | ||
189 | + | ||
190 | +/* | ||
191 | + * Joystick functions, see freeglut_joystick.c | ||
192 | + */ | ||
193 | +/* USE OF THESE FUNCTIONS IS DEPRECATED !!!!! */ | ||
194 | +/* If you have a serious need for these functions in your application, please either | ||
195 | + * contact the "freeglut" developer community at freeglut-developer@lists.sourceforge.net, | ||
196 | + * switch to the OpenGLUT library, or else port your joystick functionality over to PLIB's | ||
197 | + * "js" library. | ||
198 | + */ | ||
199 | +int glutJoystickGetNumAxes( int ident ); | ||
200 | +int glutJoystickGetNumButtons( int ident ); | ||
201 | +int glutJoystickNotWorking( int ident ); | ||
202 | +float glutJoystickGetDeadBand( int ident, int axis ); | ||
203 | +void glutJoystickSetDeadBand( int ident, int axis, float db ); | ||
204 | +float glutJoystickGetSaturation( int ident, int axis ); | ||
205 | +void glutJoystickSetSaturation( int ident, int axis, float st ); | ||
206 | +void glutJoystickSetMinRange( int ident, float *axes ); | ||
207 | +void glutJoystickSetMaxRange( int ident, float *axes ); | ||
208 | +void glutJoystickSetCenter( int ident, float *axes ); | ||
209 | +void glutJoystickGetMinRange( int ident, float *axes ); | ||
210 | +void glutJoystickGetMaxRange( int ident, float *axes ); | ||
211 | +void glutJoystickGetCenter( int ident, float *axes ); | ||
212 | + | ||
213 | +/* | ||
214 | + * Initialization functions, see freeglut_init.c | ||
215 | + */ | ||
216 | +FGAPI void FGAPIENTRY glutInitContextVersion( int majorVersion, int minorVersion ); | ||
217 | +FGAPI void FGAPIENTRY glutInitContextFlags( int flags ); | ||
218 | +FGAPI void FGAPIENTRY glutInitContextProfile( int profile ); | ||
219 | + | ||
220 | +/* to get the typedef for va_list */ | ||
221 | +#include <stdarg.h> | ||
222 | + | ||
223 | +FGAPI void FGAPIENTRY glutInitErrorFunc( void (* vError)( const char *fmt, va_list ap ) ); | ||
224 | +FGAPI void FGAPIENTRY glutInitWarningFunc( void (* vWarning)( const char *fmt, va_list ap ) ); | ||
225 | + | ||
226 | +/* | ||
227 | + * GLUT API macro definitions -- the display mode definitions | ||
228 | + */ | ||
229 | +#define GLUT_CAPTIONLESS 0x0400 | ||
230 | +#define GLUT_BORDERLESS 0x0800 | ||
231 | +#define GLUT_SRGB 0x1000 | ||
232 | + | ||
233 | +#ifdef __cplusplus | ||
234 | + } | ||
235 | +#endif | ||
236 | + | ||
237 | +/*** END OF FILE ***/ | ||
238 | + | ||
239 | +#endif /* __FREEGLUT_EXT_H__ */ |
lib/freeglut/include/GL/freeglut_std.h
0 → 100644
1 | +#ifndef __FREEGLUT_STD_H__ | ||
2 | +#define __FREEGLUT_STD_H__ | ||
3 | + | ||
4 | +/* | ||
5 | + * freeglut_std.h | ||
6 | + * | ||
7 | + * The GLUT-compatible part of the freeglut library include file | ||
8 | + * | ||
9 | + * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. | ||
10 | + * Written by Pawel W. Olszta, <olszta@sourceforge.net> | ||
11 | + * Creation date: Thu Dec 2 1999 | ||
12 | + * | ||
13 | + * Permission is hereby granted, free of charge, to any person obtaining a | ||
14 | + * copy of this software and associated documentation files (the "Software"), | ||
15 | + * to deal in the Software without restriction, including without limitation | ||
16 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
17 | + * and/or sell copies of the Software, and to permit persons to whom the | ||
18 | + * Software is furnished to do so, subject to the following conditions: | ||
19 | + * | ||
20 | + * The above copyright notice and this permission notice shall be included | ||
21 | + * in all copies or substantial portions of the Software. | ||
22 | + * | ||
23 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
24 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
25 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
26 | + * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
27 | + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
28 | + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
29 | + */ | ||
30 | + | ||
31 | +#ifdef __cplusplus | ||
32 | + extern "C" { | ||
33 | +#endif | ||
34 | + | ||
35 | +/* | ||
36 | + * Under windows, we have to differentiate between static and dynamic libraries | ||
37 | + */ | ||
38 | +#ifdef _WIN32 | ||
39 | +/* #pragma may not be supported by some compilers. | ||
40 | + * Discussion by FreeGLUT developers suggests that | ||
41 | + * Visual C++ specific code involving pragmas may | ||
42 | + * need to move to a separate header. 24th Dec 2003 | ||
43 | + */ | ||
44 | + | ||
45 | +/* Define FREEGLUT_LIB_PRAGMAS to 1 to include library | ||
46 | + * pragmas or to 0 to exclude library pragmas. | ||
47 | + * The default behavior depends on the compiler/platform. | ||
48 | + */ | ||
49 | +# ifndef FREEGLUT_LIB_PRAGMAS | ||
50 | +# if ( defined(_MSC_VER) || defined(__WATCOMC__) ) && !defined(_WIN32_WCE) | ||
51 | +# define FREEGLUT_LIB_PRAGMAS 1 | ||
52 | +# else | ||
53 | +# define FREEGLUT_LIB_PRAGMAS 0 | ||
54 | +# endif | ||
55 | +# endif | ||
56 | + | ||
57 | +# ifndef WIN32_LEAN_AND_MEAN | ||
58 | +# define WIN32_LEAN_AND_MEAN 1 | ||
59 | +# endif | ||
60 | +# ifndef NOMINMAX | ||
61 | +# define NOMINMAX | ||
62 | +# endif | ||
63 | +# include <windows.h> | ||
64 | + | ||
65 | +/* Windows static library */ | ||
66 | +# ifdef FREEGLUT_STATIC | ||
67 | + | ||
68 | +#error Static linking is not supported with this build. Please remove the FREEGLUT_STATIC preprocessor directive, or download the source code from http://freeglut.sf.net/ and build against that. | ||
69 | + | ||
70 | +/* Windows shared library (DLL) */ | ||
71 | +# else | ||
72 | + | ||
73 | +# define FGAPIENTRY __stdcall | ||
74 | +# if defined(FREEGLUT_EXPORTS) | ||
75 | +# define FGAPI __declspec(dllexport) | ||
76 | +# else | ||
77 | +# define FGAPI __declspec(dllimport) | ||
78 | + | ||
79 | + /* Link with Win32 shared freeglut lib */ | ||
80 | +# if FREEGLUT_LIB_PRAGMAS | ||
81 | +# pragma comment (lib, "freeglut.lib") | ||
82 | +# endif | ||
83 | + | ||
84 | +# endif | ||
85 | + | ||
86 | +# endif | ||
87 | + | ||
88 | +/* Drag in other Windows libraries as required by FreeGLUT */ | ||
89 | +# if FREEGLUT_LIB_PRAGMAS | ||
90 | +# pragma comment (lib, "glu32.lib") /* link OpenGL Utility lib */ | ||
91 | +# pragma comment (lib, "opengl32.lib") /* link Microsoft OpenGL lib */ | ||
92 | +# pragma comment (lib, "gdi32.lib") /* link Windows GDI lib */ | ||
93 | +# pragma comment (lib, "winmm.lib") /* link Windows MultiMedia lib */ | ||
94 | +# pragma comment (lib, "user32.lib") /* link Windows user lib */ | ||
95 | +# endif | ||
96 | + | ||
97 | +#else | ||
98 | + | ||
99 | +/* Non-Windows definition of FGAPI and FGAPIENTRY */ | ||
100 | +# define FGAPI | ||
101 | +# define FGAPIENTRY | ||
102 | + | ||
103 | +#endif | ||
104 | + | ||
105 | +/* | ||
106 | + * The freeglut and GLUT API versions | ||
107 | + */ | ||
108 | +#define FREEGLUT 1 | ||
109 | +#define GLUT_API_VERSION 4 | ||
110 | +#define GLUT_XLIB_IMPLEMENTATION 13 | ||
111 | +/* Deprecated: | ||
112 | + cf. http://sourceforge.net/mailarchive/forum.php?thread_name=CABcAi1hw7cr4xtigckaGXB5X8wddLfMcbA_rZ3NAuwMrX_zmsw%40mail.gmail.com&forum_name=freeglut-developer */ | ||
113 | +#define FREEGLUT_VERSION_2_0 1 | ||
114 | + | ||
115 | +/* | ||
116 | + * Always include OpenGL and GLU headers | ||
117 | + */ | ||
118 | +#if __APPLE__ | ||
119 | +# include <OpenGL/gl.h> | ||
120 | +# include <OpenGL/glu.h> | ||
121 | +#else | ||
122 | +# include <GL/gl.h> | ||
123 | +# include <GL/glu.h> | ||
124 | +#endif | ||
125 | + | ||
126 | +/* | ||
127 | + * GLUT API macro definitions -- the special key codes: | ||
128 | + */ | ||
129 | +#define GLUT_KEY_F1 0x0001 | ||
130 | +#define GLUT_KEY_F2 0x0002 | ||
131 | +#define GLUT_KEY_F3 0x0003 | ||
132 | +#define GLUT_KEY_F4 0x0004 | ||
133 | +#define GLUT_KEY_F5 0x0005 | ||
134 | +#define GLUT_KEY_F6 0x0006 | ||
135 | +#define GLUT_KEY_F7 0x0007 | ||
136 | +#define GLUT_KEY_F8 0x0008 | ||
137 | +#define GLUT_KEY_F9 0x0009 | ||
138 | +#define GLUT_KEY_F10 0x000A | ||
139 | +#define GLUT_KEY_F11 0x000B | ||
140 | +#define GLUT_KEY_F12 0x000C | ||
141 | +#define GLUT_KEY_LEFT 0x0064 | ||
142 | +#define GLUT_KEY_UP 0x0065 | ||
143 | +#define GLUT_KEY_RIGHT 0x0066 | ||
144 | +#define GLUT_KEY_DOWN 0x0067 | ||
145 | +#define GLUT_KEY_PAGE_UP 0x0068 | ||
146 | +#define GLUT_KEY_PAGE_DOWN 0x0069 | ||
147 | +#define GLUT_KEY_HOME 0x006A | ||
148 | +#define GLUT_KEY_END 0x006B | ||
149 | +#define GLUT_KEY_INSERT 0x006C | ||
150 | + | ||
151 | +/* | ||
152 | + * GLUT API macro definitions -- mouse state definitions | ||
153 | + */ | ||
154 | +#define GLUT_LEFT_BUTTON 0x0000 | ||
155 | +#define GLUT_MIDDLE_BUTTON 0x0001 | ||
156 | +#define GLUT_RIGHT_BUTTON 0x0002 | ||
157 | +#define GLUT_DOWN 0x0000 | ||
158 | +#define GLUT_UP 0x0001 | ||
159 | +#define GLUT_LEFT 0x0000 | ||
160 | +#define GLUT_ENTERED 0x0001 | ||
161 | + | ||
162 | +/* | ||
163 | + * GLUT API macro definitions -- the display mode definitions | ||
164 | + */ | ||
165 | +#define GLUT_RGB 0x0000 | ||
166 | +#define GLUT_RGBA 0x0000 | ||
167 | +#define GLUT_INDEX 0x0001 | ||
168 | +#define GLUT_SINGLE 0x0000 | ||
169 | +#define GLUT_DOUBLE 0x0002 | ||
170 | +#define GLUT_ACCUM 0x0004 | ||
171 | +#define GLUT_ALPHA 0x0008 | ||
172 | +#define GLUT_DEPTH 0x0010 | ||
173 | +#define GLUT_STENCIL 0x0020 | ||
174 | +#define GLUT_MULTISAMPLE 0x0080 | ||
175 | +#define GLUT_STEREO 0x0100 | ||
176 | +#define GLUT_LUMINANCE 0x0200 | ||
177 | + | ||
178 | +/* | ||
179 | + * GLUT API macro definitions -- windows and menu related definitions | ||
180 | + */ | ||
181 | +#define GLUT_MENU_NOT_IN_USE 0x0000 | ||
182 | +#define GLUT_MENU_IN_USE 0x0001 | ||
183 | +#define GLUT_NOT_VISIBLE 0x0000 | ||
184 | +#define GLUT_VISIBLE 0x0001 | ||
185 | +#define GLUT_HIDDEN 0x0000 | ||
186 | +#define GLUT_FULLY_RETAINED 0x0001 | ||
187 | +#define GLUT_PARTIALLY_RETAINED 0x0002 | ||
188 | +#define GLUT_FULLY_COVERED 0x0003 | ||
189 | + | ||
190 | +/* | ||
191 | + * GLUT API macro definitions -- fonts definitions | ||
192 | + * | ||
193 | + * Steve Baker suggested to make it binary compatible with GLUT: | ||
194 | + */ | ||
195 | +#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__WATCOMC__) | ||
196 | +# define GLUT_STROKE_ROMAN ((void *)0x0000) | ||
197 | +# define GLUT_STROKE_MONO_ROMAN ((void *)0x0001) | ||
198 | +# define GLUT_BITMAP_9_BY_15 ((void *)0x0002) | ||
199 | +# define GLUT_BITMAP_8_BY_13 ((void *)0x0003) | ||
200 | +# define GLUT_BITMAP_TIMES_ROMAN_10 ((void *)0x0004) | ||
201 | +# define GLUT_BITMAP_TIMES_ROMAN_24 ((void *)0x0005) | ||
202 | +# define GLUT_BITMAP_HELVETICA_10 ((void *)0x0006) | ||
203 | +# define GLUT_BITMAP_HELVETICA_12 ((void *)0x0007) | ||
204 | +# define GLUT_BITMAP_HELVETICA_18 ((void *)0x0008) | ||
205 | +#else | ||
206 | + /* | ||
207 | + * I don't really know if it's a good idea... But here it goes: | ||
208 | + */ | ||
209 | + extern void* glutStrokeRoman; | ||
210 | + extern void* glutStrokeMonoRoman; | ||
211 | + extern void* glutBitmap9By15; | ||
212 | + extern void* glutBitmap8By13; | ||
213 | + extern void* glutBitmapTimesRoman10; | ||
214 | + extern void* glutBitmapTimesRoman24; | ||
215 | + extern void* glutBitmapHelvetica10; | ||
216 | + extern void* glutBitmapHelvetica12; | ||
217 | + extern void* glutBitmapHelvetica18; | ||
218 | + | ||
219 | + /* | ||
220 | + * Those pointers will be used by following definitions: | ||
221 | + */ | ||
222 | +# define GLUT_STROKE_ROMAN ((void *) &glutStrokeRoman) | ||
223 | +# define GLUT_STROKE_MONO_ROMAN ((void *) &glutStrokeMonoRoman) | ||
224 | +# define GLUT_BITMAP_9_BY_15 ((void *) &glutBitmap9By15) | ||
225 | +# define GLUT_BITMAP_8_BY_13 ((void *) &glutBitmap8By13) | ||
226 | +# define GLUT_BITMAP_TIMES_ROMAN_10 ((void *) &glutBitmapTimesRoman10) | ||
227 | +# define GLUT_BITMAP_TIMES_ROMAN_24 ((void *) &glutBitmapTimesRoman24) | ||
228 | +# define GLUT_BITMAP_HELVETICA_10 ((void *) &glutBitmapHelvetica10) | ||
229 | +# define GLUT_BITMAP_HELVETICA_12 ((void *) &glutBitmapHelvetica12) | ||
230 | +# define GLUT_BITMAP_HELVETICA_18 ((void *) &glutBitmapHelvetica18) | ||
231 | +#endif | ||
232 | + | ||
233 | +/* | ||
234 | + * GLUT API macro definitions -- the glutGet parameters | ||
235 | + */ | ||
236 | +#define GLUT_WINDOW_X 0x0064 | ||
237 | +#define GLUT_WINDOW_Y 0x0065 | ||
238 | +#define GLUT_WINDOW_WIDTH 0x0066 | ||
239 | +#define GLUT_WINDOW_HEIGHT 0x0067 | ||
240 | +#define GLUT_WINDOW_BUFFER_SIZE 0x0068 | ||
241 | +#define GLUT_WINDOW_STENCIL_SIZE 0x0069 | ||
242 | +#define GLUT_WINDOW_DEPTH_SIZE 0x006A | ||
243 | +#define GLUT_WINDOW_RED_SIZE 0x006B | ||
244 | +#define GLUT_WINDOW_GREEN_SIZE 0x006C | ||
245 | +#define GLUT_WINDOW_BLUE_SIZE 0x006D | ||
246 | +#define GLUT_WINDOW_ALPHA_SIZE 0x006E | ||
247 | +#define GLUT_WINDOW_ACCUM_RED_SIZE 0x006F | ||
248 | +#define GLUT_WINDOW_ACCUM_GREEN_SIZE 0x0070 | ||
249 | +#define GLUT_WINDOW_ACCUM_BLUE_SIZE 0x0071 | ||
250 | +#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 0x0072 | ||
251 | +#define GLUT_WINDOW_DOUBLEBUFFER 0x0073 | ||
252 | +#define GLUT_WINDOW_RGBA 0x0074 | ||
253 | +#define GLUT_WINDOW_PARENT 0x0075 | ||
254 | +#define GLUT_WINDOW_NUM_CHILDREN 0x0076 | ||
255 | +#define GLUT_WINDOW_COLORMAP_SIZE 0x0077 | ||
256 | +#define GLUT_WINDOW_NUM_SAMPLES 0x0078 | ||
257 | +#define GLUT_WINDOW_STEREO 0x0079 | ||
258 | +#define GLUT_WINDOW_CURSOR 0x007A | ||
259 | + | ||
260 | +#define GLUT_SCREEN_WIDTH 0x00C8 | ||
261 | +#define GLUT_SCREEN_HEIGHT 0x00C9 | ||
262 | +#define GLUT_SCREEN_WIDTH_MM 0x00CA | ||
263 | +#define GLUT_SCREEN_HEIGHT_MM 0x00CB | ||
264 | +#define GLUT_MENU_NUM_ITEMS 0x012C | ||
265 | +#define GLUT_DISPLAY_MODE_POSSIBLE 0x0190 | ||
266 | +#define GLUT_INIT_WINDOW_X 0x01F4 | ||
267 | +#define GLUT_INIT_WINDOW_Y 0x01F5 | ||
268 | +#define GLUT_INIT_WINDOW_WIDTH 0x01F6 | ||
269 | +#define GLUT_INIT_WINDOW_HEIGHT 0x01F7 | ||
270 | +#define GLUT_INIT_DISPLAY_MODE 0x01F8 | ||
271 | +#define GLUT_ELAPSED_TIME 0x02BC | ||
272 | +#define GLUT_WINDOW_FORMAT_ID 0x007B | ||
273 | + | ||
274 | +/* | ||
275 | + * GLUT API macro definitions -- the glutDeviceGet parameters | ||
276 | + */ | ||
277 | +#define GLUT_HAS_KEYBOARD 0x0258 | ||
278 | +#define GLUT_HAS_MOUSE 0x0259 | ||
279 | +#define GLUT_HAS_SPACEBALL 0x025A | ||
280 | +#define GLUT_HAS_DIAL_AND_BUTTON_BOX 0x025B | ||
281 | +#define GLUT_HAS_TABLET 0x025C | ||
282 | +#define GLUT_NUM_MOUSE_BUTTONS 0x025D | ||
283 | +#define GLUT_NUM_SPACEBALL_BUTTONS 0x025E | ||
284 | +#define GLUT_NUM_BUTTON_BOX_BUTTONS 0x025F | ||
285 | +#define GLUT_NUM_DIALS 0x0260 | ||
286 | +#define GLUT_NUM_TABLET_BUTTONS 0x0261 | ||
287 | +#define GLUT_DEVICE_IGNORE_KEY_REPEAT 0x0262 | ||
288 | +#define GLUT_DEVICE_KEY_REPEAT 0x0263 | ||
289 | +#define GLUT_HAS_JOYSTICK 0x0264 | ||
290 | +#define GLUT_OWNS_JOYSTICK 0x0265 | ||
291 | +#define GLUT_JOYSTICK_BUTTONS 0x0266 | ||
292 | +#define GLUT_JOYSTICK_AXES 0x0267 | ||
293 | +#define GLUT_JOYSTICK_POLL_RATE 0x0268 | ||
294 | + | ||
295 | +/* | ||
296 | + * GLUT API macro definitions -- the glutLayerGet parameters | ||
297 | + */ | ||
298 | +#define GLUT_OVERLAY_POSSIBLE 0x0320 | ||
299 | +#define GLUT_LAYER_IN_USE 0x0321 | ||
300 | +#define GLUT_HAS_OVERLAY 0x0322 | ||
301 | +#define GLUT_TRANSPARENT_INDEX 0x0323 | ||
302 | +#define GLUT_NORMAL_DAMAGED 0x0324 | ||
303 | +#define GLUT_OVERLAY_DAMAGED 0x0325 | ||
304 | + | ||
305 | +/* | ||
306 | + * GLUT API macro definitions -- the glutVideoResizeGet parameters | ||
307 | + */ | ||
308 | +#define GLUT_VIDEO_RESIZE_POSSIBLE 0x0384 | ||
309 | +#define GLUT_VIDEO_RESIZE_IN_USE 0x0385 | ||
310 | +#define GLUT_VIDEO_RESIZE_X_DELTA 0x0386 | ||
311 | +#define GLUT_VIDEO_RESIZE_Y_DELTA 0x0387 | ||
312 | +#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 0x0388 | ||
313 | +#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 0x0389 | ||
314 | +#define GLUT_VIDEO_RESIZE_X 0x038A | ||
315 | +#define GLUT_VIDEO_RESIZE_Y 0x038B | ||
316 | +#define GLUT_VIDEO_RESIZE_WIDTH 0x038C | ||
317 | +#define GLUT_VIDEO_RESIZE_HEIGHT 0x038D | ||
318 | + | ||
319 | +/* | ||
320 | + * GLUT API macro definitions -- the glutUseLayer parameters | ||
321 | + */ | ||
322 | +#define GLUT_NORMAL 0x0000 | ||
323 | +#define GLUT_OVERLAY 0x0001 | ||
324 | + | ||
325 | +/* | ||
326 | + * GLUT API macro definitions -- the glutGetModifiers parameters | ||
327 | + */ | ||
328 | +#define GLUT_ACTIVE_SHIFT 0x0001 | ||
329 | +#define GLUT_ACTIVE_CTRL 0x0002 | ||
330 | +#define GLUT_ACTIVE_ALT 0x0004 | ||
331 | + | ||
332 | +/* | ||
333 | + * GLUT API macro definitions -- the glutSetCursor parameters | ||
334 | + */ | ||
335 | +#define GLUT_CURSOR_RIGHT_ARROW 0x0000 | ||
336 | +#define GLUT_CURSOR_LEFT_ARROW 0x0001 | ||
337 | +#define GLUT_CURSOR_INFO 0x0002 | ||
338 | +#define GLUT_CURSOR_DESTROY 0x0003 | ||
339 | +#define GLUT_CURSOR_HELP 0x0004 | ||
340 | +#define GLUT_CURSOR_CYCLE 0x0005 | ||
341 | +#define GLUT_CURSOR_SPRAY 0x0006 | ||
342 | +#define GLUT_CURSOR_WAIT 0x0007 | ||
343 | +#define GLUT_CURSOR_TEXT 0x0008 | ||
344 | +#define GLUT_CURSOR_CROSSHAIR 0x0009 | ||
345 | +#define GLUT_CURSOR_UP_DOWN 0x000A | ||
346 | +#define GLUT_CURSOR_LEFT_RIGHT 0x000B | ||
347 | +#define GLUT_CURSOR_TOP_SIDE 0x000C | ||
348 | +#define GLUT_CURSOR_BOTTOM_SIDE 0x000D | ||
349 | +#define GLUT_CURSOR_LEFT_SIDE 0x000E | ||
350 | +#define GLUT_CURSOR_RIGHT_SIDE 0x000F | ||
351 | +#define GLUT_CURSOR_TOP_LEFT_CORNER 0x0010 | ||
352 | +#define GLUT_CURSOR_TOP_RIGHT_CORNER 0x0011 | ||
353 | +#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 0x0012 | ||
354 | +#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 0x0013 | ||
355 | +#define GLUT_CURSOR_INHERIT 0x0064 | ||
356 | +#define GLUT_CURSOR_NONE 0x0065 | ||
357 | +#define GLUT_CURSOR_FULL_CROSSHAIR 0x0066 | ||
358 | + | ||
359 | +/* | ||
360 | + * GLUT API macro definitions -- RGB color component specification definitions | ||
361 | + */ | ||
362 | +#define GLUT_RED 0x0000 | ||
363 | +#define GLUT_GREEN 0x0001 | ||
364 | +#define GLUT_BLUE 0x0002 | ||
365 | + | ||
366 | +/* | ||
367 | + * GLUT API macro definitions -- additional keyboard and joystick definitions | ||
368 | + */ | ||
369 | +#define GLUT_KEY_REPEAT_OFF 0x0000 | ||
370 | +#define GLUT_KEY_REPEAT_ON 0x0001 | ||
371 | +#define GLUT_KEY_REPEAT_DEFAULT 0x0002 | ||
372 | + | ||
373 | +#define GLUT_JOYSTICK_BUTTON_A 0x0001 | ||
374 | +#define GLUT_JOYSTICK_BUTTON_B 0x0002 | ||
375 | +#define GLUT_JOYSTICK_BUTTON_C 0x0004 | ||
376 | +#define GLUT_JOYSTICK_BUTTON_D 0x0008 | ||
377 | + | ||
378 | +/* | ||
379 | + * GLUT API macro definitions -- game mode definitions | ||
380 | + */ | ||
381 | +#define GLUT_GAME_MODE_ACTIVE 0x0000 | ||
382 | +#define GLUT_GAME_MODE_POSSIBLE 0x0001 | ||
383 | +#define GLUT_GAME_MODE_WIDTH 0x0002 | ||
384 | +#define GLUT_GAME_MODE_HEIGHT 0x0003 | ||
385 | +#define GLUT_GAME_MODE_PIXEL_DEPTH 0x0004 | ||
386 | +#define GLUT_GAME_MODE_REFRESH_RATE 0x0005 | ||
387 | +#define GLUT_GAME_MODE_DISPLAY_CHANGED 0x0006 | ||
388 | + | ||
389 | +/* | ||
390 | + * Initialization functions, see fglut_init.c | ||
391 | + */ | ||
392 | +FGAPI void FGAPIENTRY glutInit( int* pargc, char** argv ); | ||
393 | +FGAPI void FGAPIENTRY glutInitWindowPosition( int x, int y ); | ||
394 | +FGAPI void FGAPIENTRY glutInitWindowSize( int width, int height ); | ||
395 | +FGAPI void FGAPIENTRY glutInitDisplayMode( unsigned int displayMode ); | ||
396 | +FGAPI void FGAPIENTRY glutInitDisplayString( const char* displayMode ); | ||
397 | + | ||
398 | +/* | ||
399 | + * Process loop function, see freeglut_main.c | ||
400 | + */ | ||
401 | +FGAPI void FGAPIENTRY glutMainLoop( void ); | ||
402 | + | ||
403 | +/* | ||
404 | + * Window management functions, see freeglut_window.c | ||
405 | + */ | ||
406 | +FGAPI int FGAPIENTRY glutCreateWindow( const char* title ); | ||
407 | +FGAPI int FGAPIENTRY glutCreateSubWindow( int window, int x, int y, int width, int height ); | ||
408 | +FGAPI void FGAPIENTRY glutDestroyWindow( int window ); | ||
409 | +FGAPI void FGAPIENTRY glutSetWindow( int window ); | ||
410 | +FGAPI int FGAPIENTRY glutGetWindow( void ); | ||
411 | +FGAPI void FGAPIENTRY glutSetWindowTitle( const char* title ); | ||
412 | +FGAPI void FGAPIENTRY glutSetIconTitle( const char* title ); | ||
413 | +FGAPI void FGAPIENTRY glutReshapeWindow( int width, int height ); | ||
414 | +FGAPI void FGAPIENTRY glutPositionWindow( int x, int y ); | ||
415 | +FGAPI void FGAPIENTRY glutShowWindow( void ); | ||
416 | +FGAPI void FGAPIENTRY glutHideWindow( void ); | ||
417 | +FGAPI void FGAPIENTRY glutIconifyWindow( void ); | ||
418 | +FGAPI void FGAPIENTRY glutPushWindow( void ); | ||
419 | +FGAPI void FGAPIENTRY glutPopWindow( void ); | ||
420 | +FGAPI void FGAPIENTRY glutFullScreen( void ); | ||
421 | + | ||
422 | +/* | ||
423 | + * Display-connected functions, see freeglut_display.c | ||
424 | + */ | ||
425 | +FGAPI void FGAPIENTRY glutPostWindowRedisplay( int window ); | ||
426 | +FGAPI void FGAPIENTRY glutPostRedisplay( void ); | ||
427 | +FGAPI void FGAPIENTRY glutSwapBuffers( void ); | ||
428 | + | ||
429 | +/* | ||
430 | + * Mouse cursor functions, see freeglut_cursor.c | ||
431 | + */ | ||
432 | +FGAPI void FGAPIENTRY glutWarpPointer( int x, int y ); | ||
433 | +FGAPI void FGAPIENTRY glutSetCursor( int cursor ); | ||
434 | + | ||
435 | +/* | ||
436 | + * Overlay stuff, see freeglut_overlay.c | ||
437 | + */ | ||
438 | +FGAPI void FGAPIENTRY glutEstablishOverlay( void ); | ||
439 | +FGAPI void FGAPIENTRY glutRemoveOverlay( void ); | ||
440 | +FGAPI void FGAPIENTRY glutUseLayer( GLenum layer ); | ||
441 | +FGAPI void FGAPIENTRY glutPostOverlayRedisplay( void ); | ||
442 | +FGAPI void FGAPIENTRY glutPostWindowOverlayRedisplay( int window ); | ||
443 | +FGAPI void FGAPIENTRY glutShowOverlay( void ); | ||
444 | +FGAPI void FGAPIENTRY glutHideOverlay( void ); | ||
445 | + | ||
446 | +/* | ||
447 | + * Menu stuff, see freeglut_menu.c | ||
448 | + */ | ||
449 | +FGAPI int FGAPIENTRY glutCreateMenu( void (* callback)( int menu ) ); | ||
450 | +FGAPI void FGAPIENTRY glutDestroyMenu( int menu ); | ||
451 | +FGAPI int FGAPIENTRY glutGetMenu( void ); | ||
452 | +FGAPI void FGAPIENTRY glutSetMenu( int menu ); | ||
453 | +FGAPI void FGAPIENTRY glutAddMenuEntry( const char* label, int value ); | ||
454 | +FGAPI void FGAPIENTRY glutAddSubMenu( const char* label, int subMenu ); | ||
455 | +FGAPI void FGAPIENTRY glutChangeToMenuEntry( int item, const char* label, int value ); | ||
456 | +FGAPI void FGAPIENTRY glutChangeToSubMenu( int item, const char* label, int value ); | ||
457 | +FGAPI void FGAPIENTRY glutRemoveMenuItem( int item ); | ||
458 | +FGAPI void FGAPIENTRY glutAttachMenu( int button ); | ||
459 | +FGAPI void FGAPIENTRY glutDetachMenu( int button ); | ||
460 | + | ||
461 | +/* | ||
462 | + * Global callback functions, see freeglut_callbacks.c | ||
463 | + */ | ||
464 | +FGAPI void FGAPIENTRY glutTimerFunc( unsigned int time, void (* callback)( int ), int value ); | ||
465 | +FGAPI void FGAPIENTRY glutIdleFunc( void (* callback)( void ) ); | ||
466 | + | ||
467 | +/* | ||
468 | + * Window-specific callback functions, see freeglut_callbacks.c | ||
469 | + */ | ||
470 | +FGAPI void FGAPIENTRY glutKeyboardFunc( void (* callback)( unsigned char, int, int ) ); | ||
471 | +FGAPI void FGAPIENTRY glutSpecialFunc( void (* callback)( int, int, int ) ); | ||
472 | +FGAPI void FGAPIENTRY glutReshapeFunc( void (* callback)( int, int ) ); | ||
473 | +FGAPI void FGAPIENTRY glutVisibilityFunc( void (* callback)( int ) ); | ||
474 | +FGAPI void FGAPIENTRY glutDisplayFunc( void (* callback)( void ) ); | ||
475 | +FGAPI void FGAPIENTRY glutMouseFunc( void (* callback)( int, int, int, int ) ); | ||
476 | +FGAPI void FGAPIENTRY glutMotionFunc( void (* callback)( int, int ) ); | ||
477 | +FGAPI void FGAPIENTRY glutPassiveMotionFunc( void (* callback)( int, int ) ); | ||
478 | +FGAPI void FGAPIENTRY glutEntryFunc( void (* callback)( int ) ); | ||
479 | + | ||
480 | +FGAPI void FGAPIENTRY glutKeyboardUpFunc( void (* callback)( unsigned char, int, int ) ); | ||
481 | +FGAPI void FGAPIENTRY glutSpecialUpFunc( void (* callback)( int, int, int ) ); | ||
482 | +FGAPI void FGAPIENTRY glutJoystickFunc( void (* callback)( unsigned int, int, int, int ), int pollInterval ); | ||
483 | +FGAPI void FGAPIENTRY glutMenuStateFunc( void (* callback)( int ) ); | ||
484 | +FGAPI void FGAPIENTRY glutMenuStatusFunc( void (* callback)( int, int, int ) ); | ||
485 | +FGAPI void FGAPIENTRY glutOverlayDisplayFunc( void (* callback)( void ) ); | ||
486 | +FGAPI void FGAPIENTRY glutWindowStatusFunc( void (* callback)( int ) ); | ||
487 | + | ||
488 | +FGAPI void FGAPIENTRY glutSpaceballMotionFunc( void (* callback)( int, int, int ) ); | ||
489 | +FGAPI void FGAPIENTRY glutSpaceballRotateFunc( void (* callback)( int, int, int ) ); | ||
490 | +FGAPI void FGAPIENTRY glutSpaceballButtonFunc( void (* callback)( int, int ) ); | ||
491 | +FGAPI void FGAPIENTRY glutButtonBoxFunc( void (* callback)( int, int ) ); | ||
492 | +FGAPI void FGAPIENTRY glutDialsFunc( void (* callback)( int, int ) ); | ||
493 | +FGAPI void FGAPIENTRY glutTabletMotionFunc( void (* callback)( int, int ) ); | ||
494 | +FGAPI void FGAPIENTRY glutTabletButtonFunc( void (* callback)( int, int, int, int ) ); | ||
495 | + | ||
496 | +/* | ||
497 | + * State setting and retrieval functions, see freeglut_state.c | ||
498 | + */ | ||
499 | +FGAPI int FGAPIENTRY glutGet( GLenum query ); | ||
500 | +FGAPI int FGAPIENTRY glutDeviceGet( GLenum query ); | ||
501 | +FGAPI int FGAPIENTRY glutGetModifiers( void ); | ||
502 | +FGAPI int FGAPIENTRY glutLayerGet( GLenum query ); | ||
503 | + | ||
504 | +/* | ||
505 | + * Font stuff, see freeglut_font.c | ||
506 | + */ | ||
507 | +FGAPI void FGAPIENTRY glutBitmapCharacter( void* font, int character ); | ||
508 | +FGAPI int FGAPIENTRY glutBitmapWidth( void* font, int character ); | ||
509 | +FGAPI void FGAPIENTRY glutStrokeCharacter( void* font, int character ); | ||
510 | +FGAPI int FGAPIENTRY glutStrokeWidth( void* font, int character ); | ||
511 | +FGAPI int FGAPIENTRY glutBitmapLength( void* font, const unsigned char* string ); | ||
512 | +FGAPI int FGAPIENTRY glutStrokeLength( void* font, const unsigned char* string ); | ||
513 | + | ||
514 | +/* | ||
515 | + * Geometry functions, see freeglut_geometry.c | ||
516 | + */ | ||
517 | +FGAPI void FGAPIENTRY glutWireCube( GLdouble size ); | ||
518 | +FGAPI void FGAPIENTRY glutSolidCube( GLdouble size ); | ||
519 | +FGAPI void FGAPIENTRY glutWireSphere( GLdouble radius, GLint slices, GLint stacks ); | ||
520 | +FGAPI void FGAPIENTRY glutSolidSphere( GLdouble radius, GLint slices, GLint stacks ); | ||
521 | +FGAPI void FGAPIENTRY glutWireCone( GLdouble base, GLdouble height, GLint slices, GLint stacks ); | ||
522 | +FGAPI void FGAPIENTRY glutSolidCone( GLdouble base, GLdouble height, GLint slices, GLint stacks ); | ||
523 | + | ||
524 | +FGAPI void FGAPIENTRY glutWireTorus( GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings ); | ||
525 | +FGAPI void FGAPIENTRY glutSolidTorus( GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings ); | ||
526 | +FGAPI void FGAPIENTRY glutWireDodecahedron( void ); | ||
527 | +FGAPI void FGAPIENTRY glutSolidDodecahedron( void ); | ||
528 | +FGAPI void FGAPIENTRY glutWireOctahedron( void ); | ||
529 | +FGAPI void FGAPIENTRY glutSolidOctahedron( void ); | ||
530 | +FGAPI void FGAPIENTRY glutWireTetrahedron( void ); | ||
531 | +FGAPI void FGAPIENTRY glutSolidTetrahedron( void ); | ||
532 | +FGAPI void FGAPIENTRY glutWireIcosahedron( void ); | ||
533 | +FGAPI void FGAPIENTRY glutSolidIcosahedron( void ); | ||
534 | + | ||
535 | +/* | ||
536 | + * Teapot rendering functions, found in freeglut_teapot.c | ||
537 | + * NB: front facing polygons have clockwise winding, not counter clockwise | ||
538 | + */ | ||
539 | +FGAPI void FGAPIENTRY glutWireTeapot( GLdouble size ); | ||
540 | +FGAPI void FGAPIENTRY glutSolidTeapot( GLdouble size ); | ||
541 | + | ||
542 | +/* | ||
543 | + * Game mode functions, see freeglut_gamemode.c | ||
544 | + */ | ||
545 | +FGAPI void FGAPIENTRY glutGameModeString( const char* string ); | ||
546 | +FGAPI int FGAPIENTRY glutEnterGameMode( void ); | ||
547 | +FGAPI void FGAPIENTRY glutLeaveGameMode( void ); | ||
548 | +FGAPI int FGAPIENTRY glutGameModeGet( GLenum query ); | ||
549 | + | ||
550 | +/* | ||
551 | + * Video resize functions, see freeglut_videoresize.c | ||
552 | + */ | ||
553 | +FGAPI int FGAPIENTRY glutVideoResizeGet( GLenum query ); | ||
554 | +FGAPI void FGAPIENTRY glutSetupVideoResizing( void ); | ||
555 | +FGAPI void FGAPIENTRY glutStopVideoResizing( void ); | ||
556 | +FGAPI void FGAPIENTRY glutVideoResize( int x, int y, int width, int height ); | ||
557 | +FGAPI void FGAPIENTRY glutVideoPan( int x, int y, int width, int height ); | ||
558 | + | ||
559 | +/* | ||
560 | + * Colormap functions, see freeglut_misc.c | ||
561 | + */ | ||
562 | +FGAPI void FGAPIENTRY glutSetColor( int color, GLfloat red, GLfloat green, GLfloat blue ); | ||
563 | +FGAPI GLfloat FGAPIENTRY glutGetColor( int color, int component ); | ||
564 | +FGAPI void FGAPIENTRY glutCopyColormap( int window ); | ||
565 | + | ||
566 | +/* | ||
567 | + * Misc keyboard and joystick functions, see freeglut_misc.c | ||
568 | + */ | ||
569 | +FGAPI void FGAPIENTRY glutIgnoreKeyRepeat( int ignore ); | ||
570 | +FGAPI void FGAPIENTRY glutSetKeyRepeat( int repeatMode ); | ||
571 | +FGAPI void FGAPIENTRY glutForceJoystickFunc( void ); | ||
572 | + | ||
573 | +/* | ||
574 | + * Misc functions, see freeglut_misc.c | ||
575 | + */ | ||
576 | +FGAPI int FGAPIENTRY glutExtensionSupported( const char* extension ); | ||
577 | +FGAPI void FGAPIENTRY glutReportErrors( void ); | ||
578 | + | ||
579 | +/* Comment from glut.h of classic GLUT: | ||
580 | + | ||
581 | + Win32 has an annoying issue where there are multiple C run-time | ||
582 | + libraries (CRTs). If the executable is linked with a different CRT | ||
583 | + from the GLUT DLL, the GLUT DLL will not share the same CRT static | ||
584 | + data seen by the executable. In particular, atexit callbacks registered | ||
585 | + in the executable will not be called if GLUT calls its (different) | ||
586 | + exit routine). GLUT is typically built with the | ||
587 | + "/MD" option (the CRT with multithreading DLL support), but the Visual | ||
588 | + C++ linker default is "/ML" (the single threaded CRT). | ||
589 | + | ||
590 | + One workaround to this issue is requiring users to always link with | ||
591 | + the same CRT as GLUT is compiled with. That requires users supply a | ||
592 | + non-standard option. GLUT 3.7 has its own built-in workaround where | ||
593 | + the executable's "exit" function pointer is covertly passed to GLUT. | ||
594 | + GLUT then calls the executable's exit function pointer to ensure that | ||
595 | + any "atexit" calls registered by the application are called if GLUT | ||
596 | + needs to exit. | ||
597 | + | ||
598 | + Note that the __glut*WithExit routines should NEVER be called directly. | ||
599 | + To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */ | ||
600 | + | ||
601 | +/* to get the prototype for exit() */ | ||
602 | +#include <stdlib.h> | ||
603 | + | ||
604 | +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) && !defined(__WATCOMC__) | ||
605 | +FGAPI void FGAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int)); | ||
606 | +FGAPI int FGAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int)); | ||
607 | +FGAPI int FGAPIENTRY __glutCreateMenuWithExit(void (* func)(int), void (__cdecl *exitfunc)(int)); | ||
608 | +#ifndef FREEGLUT_BUILDING_LIB | ||
609 | +#if defined(__GNUC__) | ||
610 | +#define FGUNUSED __attribute__((unused)) | ||
611 | +#else | ||
612 | +#define FGUNUSED | ||
613 | +#endif | ||
614 | +static void FGAPIENTRY FGUNUSED glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); } | ||
615 | +#define glutInit glutInit_ATEXIT_HACK | ||
616 | +static int FGAPIENTRY FGUNUSED glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); } | ||
617 | +#define glutCreateWindow glutCreateWindow_ATEXIT_HACK | ||
618 | +static int FGAPIENTRY FGUNUSED glutCreateMenu_ATEXIT_HACK(void (* func)(int)) { return __glutCreateMenuWithExit(func, exit); } | ||
619 | +#define glutCreateMenu glutCreateMenu_ATEXIT_HACK | ||
620 | +#endif | ||
621 | +#endif | ||
622 | + | ||
623 | +#ifdef __cplusplus | ||
624 | + } | ||
625 | +#endif | ||
626 | + | ||
627 | +/*** END OF FILE ***/ | ||
628 | + | ||
629 | +#endif /* __FREEGLUT_STD_H__ */ | ||
630 | + |
lib/freeglut/include/GL/glut.h
0 → 100644
1 | +#ifndef __GLUT_H__ | ||
2 | +#define __GLUT_H__ | ||
3 | + | ||
4 | +/* | ||
5 | + * glut.h | ||
6 | + * | ||
7 | + * The freeglut library include file | ||
8 | + * | ||
9 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
10 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
11 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
12 | + * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
13 | + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
14 | + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
15 | + */ | ||
16 | + | ||
17 | +#include "freeglut_std.h" | ||
18 | + | ||
19 | +/*** END OF FILE ***/ | ||
20 | + | ||
21 | +#endif /* __GLUT_H__ */ |
lib/freeglut/lib/freeglut.lib
0 → 100644
No preview for this file type
lib/freeglut/lib/x64/freeglut.lib
0 → 100644
No preview for this file type
mymodel.obj
0 → 100644
This diff could not be displayed because it is too large.
result.png
0 → 100644
289 KB
sol.cpp
0 → 100644
1 | +#include "Renderer.h" | ||
2 | + | ||
3 | +GLubyte mytexels[2048][2048][3]; | ||
4 | + | ||
5 | +Vertex* face; | ||
6 | +Vertex* vt; | ||
7 | +Vertex* vn; | ||
8 | + | ||
9 | +int face_n; | ||
10 | + | ||
11 | +void draw_center(void) { | ||
12 | + glBegin(GL_LINES); | ||
13 | + glColor3f(1.0f, 0.0f, 0.0f); /* R */ | ||
14 | + glVertex3f(0.0f, 0.0f, 0.0f); | ||
15 | + glVertex3f(0.2f, 0.0f, 0.0f); | ||
16 | + glEnd(); | ||
17 | + glRasterPos3f(0.2f, 0.0f, 0.0f); | ||
18 | + glutBitmapCharacter(GLUT_BITMAP_9_BY_15, 'x'); | ||
19 | + | ||
20 | + glBegin(GL_LINES); | ||
21 | + glColor3f(0.0f, 1.0f, 0.0f); /* G */ | ||
22 | + glVertex3f(0.0f, 0.2f, 0.0f); | ||
23 | + glVertex3f(0.0f, 0.0f, 0.0f); | ||
24 | + glEnd(); | ||
25 | + glRasterPos3f(0.0f, 0.2f, 0.0f); | ||
26 | + glutBitmapCharacter(GLUT_BITMAP_9_BY_15, 'y'); | ||
27 | + | ||
28 | + glBegin(GL_LINES); | ||
29 | + glColor3f(0.0f, 0.0f, 1.0f); /* B */ | ||
30 | + glVertex3f(0.0f, 0.0f, -0.2f); | ||
31 | + glVertex3f(0.0f, 0.0f, 0.0f); | ||
32 | + glEnd(); | ||
33 | + glRasterPos3f(0.0f, 0.0f, -0.2f); | ||
34 | + glutBitmapCharacter(GLUT_BITMAP_9_BY_15, 'z'); | ||
35 | +} | ||
36 | + | ||
37 | +void idle() { | ||
38 | + static GLuint previousClock = glutGet(GLUT_ELAPSED_TIME); | ||
39 | + static GLuint currentClock = glutGet(GLUT_ELAPSED_TIME); | ||
40 | + static GLfloat deltaT; | ||
41 | + | ||
42 | + currentClock = glutGet(GLUT_ELAPSED_TIME); | ||
43 | + deltaT = currentClock - previousClock; | ||
44 | + if (deltaT < 1000.0 / 20.0) { return; } | ||
45 | + else { previousClock = currentClock; } | ||
46 | + | ||
47 | + //char buff[256]; | ||
48 | + //sprintf_s(buff, "Frame Rate = %f", 1000.0 / deltaT); | ||
49 | + //frameRate = buff; | ||
50 | + | ||
51 | + glutPostRedisplay(); | ||
52 | +} | ||
53 | + | ||
54 | +void close() { | ||
55 | + glDeleteTextures(1, &dispBindIndex); | ||
56 | + glutLeaveMainLoop(); | ||
57 | +} | ||
58 | + | ||
59 | +void add_quats(float q1[4], float q2[4], float dest[4]) { | ||
60 | + static int count = 0; | ||
61 | + float t1[4], t2[4], t3[4]; | ||
62 | + float tf[4]; | ||
63 | + | ||
64 | + vcopy(q1, t1); | ||
65 | + vscale(t1, q2[3]); | ||
66 | + | ||
67 | + vcopy(q2, t2); | ||
68 | + vscale(t2, q1[3]); | ||
69 | + | ||
70 | + vcross(q2, q1, t3); | ||
71 | + vadd(t1, t2, tf); | ||
72 | + vadd(t3, tf, tf); | ||
73 | + tf[3] = q1[3] * q2[3] - vdot(q1, q2); | ||
74 | + | ||
75 | + dest[0] = tf[0]; | ||
76 | + dest[1] = tf[1]; | ||
77 | + dest[2] = tf[2]; | ||
78 | + dest[3] = tf[3]; | ||
79 | + | ||
80 | + if (++count > RENORMCOUNT) { | ||
81 | + count = 0; | ||
82 | + normalize_quat(dest); | ||
83 | + } | ||
84 | +} | ||
85 | + | ||
86 | +void reshape(int width, int height) { | ||
87 | + glViewport(0, 0, width, height); | ||
88 | + glMatrixMode(GL_PROJECTION); | ||
89 | + glLoadIdentity(); | ||
90 | + gluPerspective(58, (double)width / height, 0.1, 100); | ||
91 | + glMatrixMode(GL_MODELVIEW); | ||
92 | +} | ||
93 | + | ||
94 | +void motion(int x, int y) { | ||
95 | + GLfloat spin_quat[4]; | ||
96 | + float gain; | ||
97 | + gain = 2.0; /* trackball gain */ | ||
98 | + | ||
99 | + if (drag_state == GLUT_DOWN) { | ||
100 | + if (button_state == GLUT_LEFT_BUTTON) { | ||
101 | + trackball(spin_quat, | ||
102 | + (gain * rot_x - 500) / 500, | ||
103 | + (500 - gain * rot_y) / 500, | ||
104 | + (gain * x - 500) / 500, | ||
105 | + (500 - gain * y) / 500); | ||
106 | + add_quats(spin_quat, quat, quat); | ||
107 | + } | ||
108 | + else if (button_state == GLUT_RIGHT_BUTTON) { | ||
109 | + t[0] -= (((float)trans_x - x) / 500); | ||
110 | + t[1] += (((float)trans_y - y) / 500); | ||
111 | + } else if (button_state == GLUT_MIDDLE_BUTTON) | ||
112 | + t[2] -= (((float)trans_z - y) / 500 * 4); | ||
113 | + else if (button_state == 3 || button_state == 4) { | ||
114 | + | ||
115 | + } | ||
116 | + //glutPostRedisplay(); | ||
117 | + } | ||
118 | + | ||
119 | + rot_x = x; | ||
120 | + rot_y = y; | ||
121 | + | ||
122 | + trans_x = x; | ||
123 | + trans_y = y; | ||
124 | + trans_z = y; | ||
125 | +} | ||
126 | + | ||
127 | +void mouse(int button, int state, int x, int y) { | ||
128 | + if (state == GLUT_DOWN) { | ||
129 | + if (button == GLUT_LEFT_BUTTON) { | ||
130 | + rot_x = x; | ||
131 | + rot_y = y; | ||
132 | + | ||
133 | + //t[0] = t[0] + 1; | ||
134 | + | ||
135 | + | ||
136 | + } | ||
137 | + else if (button == GLUT_RIGHT_BUTTON) { | ||
138 | + trans_x = x; | ||
139 | + trans_y = y; | ||
140 | + } else if (button == GLUT_MIDDLE_BUTTON) { | ||
141 | + trans_z = y; | ||
142 | + } else if (button == 3 || button == 4) { | ||
143 | + const float sign = (static_cast<float>(button)-3.5f) * 2.0f; | ||
144 | + t[2] -= sign * 500 * 0.00015f; | ||
145 | + } | ||
146 | + } | ||
147 | + | ||
148 | + drag_state = state; | ||
149 | + button_state = button; | ||
150 | +} | ||
151 | + | ||
152 | +void vzero(float* v) { | ||
153 | + v[0] = 0.0f; | ||
154 | + v[1] = 0.0f; | ||
155 | + v[2] = 0.0f; | ||
156 | +} | ||
157 | + | ||
158 | +void vset(float* v, float x, float y, float z) { | ||
159 | + v[0] = x; | ||
160 | + v[1] = y; | ||
161 | + v[2] = z; | ||
162 | +} | ||
163 | + | ||
164 | +void vsub(const float *src1, const float *src2, float *dst) { | ||
165 | + dst[0] = src1[0] - src2[0]; | ||
166 | + dst[1] = src1[1] - src2[1]; | ||
167 | + dst[2] = src1[2] - src2[2]; | ||
168 | +} | ||
169 | + | ||
170 | +void vcopy(const float *v1, float *v2) { | ||
171 | + register int i; | ||
172 | + for (i = 0; i < 3; i++) | ||
173 | + v2[i] = v1[i]; | ||
174 | +} | ||
175 | + | ||
176 | +void vcross(const float *v1, const float *v2, float *cross) { | ||
177 | + float temp[3]; | ||
178 | + | ||
179 | + temp[0] = (v1[1] * v2[2]) - (v1[2] * v2[1]); | ||
180 | + temp[1] = (v1[2] * v2[0]) - (v1[0] * v2[2]); | ||
181 | + temp[2] = (v1[0] * v2[1]) - (v1[1] * v2[0]); | ||
182 | + vcopy(temp, cross); | ||
183 | +} | ||
184 | + | ||
185 | +float vlength(const float *v) { | ||
186 | + return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); | ||
187 | +} | ||
188 | + | ||
189 | +void vscale(float *v, float div) { | ||
190 | + v[0] *= div; | ||
191 | + v[1] *= div; | ||
192 | + v[2] *= div; | ||
193 | +} | ||
194 | + | ||
195 | +void vnormal(float *v) { | ||
196 | + vscale(v, 1.0f / vlength(v)); | ||
197 | +} | ||
198 | + | ||
199 | +float vdot(const float *v1, const float *v2) { | ||
200 | + return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]; | ||
201 | +} | ||
202 | + | ||
203 | +void vadd(const float *src1, const float *src2, float *dst) { | ||
204 | + dst[0] = src1[0] + src2[0]; | ||
205 | + dst[1] = src1[1] + src2[1]; | ||
206 | + dst[2] = src1[2] + src2[2]; | ||
207 | +} | ||
208 | + | ||
209 | +void trackball(float q[4], float p1x, float p1y, float p2x, float p2y) { | ||
210 | + float a[3]; /* Axis of rotation */ | ||
211 | + float phi; /* how much to rotate about axis */ | ||
212 | + float p1[3], p2[3], d[3]; | ||
213 | + float t; | ||
214 | + | ||
215 | + if (p1x == p2x && p1y == p2y) { | ||
216 | + /* Zero rotation */ | ||
217 | + vzero(q); | ||
218 | + q[3] = 1.0; | ||
219 | + return; | ||
220 | + } | ||
221 | + | ||
222 | + /* | ||
223 | + * First, figure out z-coordinates for projection of P1 and P2 to | ||
224 | + * deformed sphere | ||
225 | + */ | ||
226 | + vset(p1, p1x, p1y, tb_project_to_sphere(TRACKBALLSIZE, p1x, p1y)); | ||
227 | + vset(p2, p2x, p2y, tb_project_to_sphere(TRACKBALLSIZE, p2x, p2y)); | ||
228 | + | ||
229 | + /* | ||
230 | + * Now, we want the cross product of P1 and P2 | ||
231 | + */ | ||
232 | + vcross(p2, p1, a); | ||
233 | + | ||
234 | + /* | ||
235 | + * Figure out how much to rotate around that axis. | ||
236 | + */ | ||
237 | + vsub(p1, p2, d); | ||
238 | + t = vlength(d) / (2.0f*TRACKBALLSIZE); | ||
239 | + | ||
240 | + /* | ||
241 | + * Avoid problems with out-of-control values... | ||
242 | + */ | ||
243 | + if (t > 1.0) t = 1.0; | ||
244 | + if (t < -1.0) t = -1.0; | ||
245 | + phi = 2.0f * asin(t); | ||
246 | + | ||
247 | + axis_to_quat(a, phi, q); | ||
248 | +} | ||
249 | + | ||
250 | +void axis_to_quat(float a[3], float phi, float q[4]) { | ||
251 | + vnormal(a); | ||
252 | + vcopy(a, q); | ||
253 | + vscale(q, sin(phi / 2.0f)); | ||
254 | + q[3] = cos(phi / 2.0f); | ||
255 | +} | ||
256 | + | ||
257 | +float tb_project_to_sphere(float r, float x, float y) { | ||
258 | + float d, t, z; | ||
259 | + | ||
260 | + d = sqrt(x*x + y*y); | ||
261 | + if (d < r * 0.70710678118654752440f) { /* Inside sphere */ | ||
262 | + z = sqrt(r*r - d*d); | ||
263 | + } else { /* On hyperbola */ | ||
264 | + t = r / 1.41421356237309504880f; | ||
265 | + z = t*t / d; | ||
266 | + } | ||
267 | + return z; | ||
268 | +} | ||
269 | + | ||
270 | +void normalize_quat(float q[4]) { | ||
271 | + int i; | ||
272 | + float mag; | ||
273 | + | ||
274 | + mag = (q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3]); | ||
275 | + for (i = 0; i < 4; i++) q[i] /= mag; | ||
276 | +} | ||
277 | + | ||
278 | +void build_rotmatrix(float m[4][4], float q[4]) { | ||
279 | + m[0][0] = 1.0f - 2.0f * (q[1] * q[1] + q[2] * q[2]); | ||
280 | + m[0][1] = 2.0f * (q[0] * q[1] - q[2] * q[3]); | ||
281 | + m[0][2] = 2.0f * (q[2] * q[0] + q[1] * q[3]); | ||
282 | + m[0][3] = 0.0f; | ||
283 | + | ||
284 | + m[1][0] = 2.0f * (q[0] * q[1] + q[2] * q[3]); | ||
285 | + m[1][1] = 1.0f - 2.0f * (q[2] * q[2] + q[0] * q[0]); | ||
286 | + m[1][2] = 2.0f * (q[1] * q[2] - q[0] * q[3]); | ||
287 | + m[1][3] = 0.0f; | ||
288 | + | ||
289 | + m[2][0] = 2.0f * (q[2] * q[0] - q[1] * q[3]); | ||
290 | + m[2][1] = 2.0f * (q[1] * q[2] + q[0] * q[3]); | ||
291 | + m[2][2] = 1.0f - 2.0f * (q[1] * q[1] + q[0] * q[0]); | ||
292 | + m[2][3] = 0.0f; | ||
293 | + | ||
294 | + m[3][0] = 0.0f; | ||
295 | + m[3][1] = 0.0f; | ||
296 | + m[3][2] = 0.0f; | ||
297 | + m[3][3] = 1.0f; | ||
298 | +} | ||
299 | + | ||
300 | +void InitializeWindow(int argc, char* argv[]) { | ||
301 | + // initialize glut settings | ||
302 | + glutInit(&argc, argv); | ||
303 | + | ||
304 | + glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH); | ||
305 | + glutInitWindowSize(1000 / 2, 1000 / 2); | ||
306 | + | ||
307 | + glutInitWindowPosition(0, 0); | ||
308 | + | ||
309 | + dispWindowIndex = glutCreateWindow("3D Model"); | ||
310 | + | ||
311 | + trackball(quat, 90.0, 0.0, 0.0, 0.0); | ||
312 | + | ||
313 | + glutIdleFunc(idle); | ||
314 | + glutDisplayFunc(display); | ||
315 | + glutReshapeFunc(reshape); | ||
316 | + glutSpecialFunc(special); | ||
317 | + glutMotionFunc(motion); | ||
318 | + glutMouseFunc(mouse); | ||
319 | + glutCloseFunc(close); | ||
320 | + | ||
321 | + glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS); | ||
322 | + | ||
323 | + // bind textures | ||
324 | + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); | ||
325 | + glEnable(GL_DEPTH_TEST); | ||
326 | + reshape(1000, 1000); | ||
327 | + | ||
328 | + /*glGenTextures(1, &dispBindIndex); | ||
329 | + glBindTexture(GL_TEXTURE_2D, dispBindIndex); | ||
330 | + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | ||
331 | + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);*/ | ||
332 | +} | ||
333 | + | ||
334 | +void f(int i, int j); | ||
335 | + | ||
336 | +void display() { | ||
337 | + static int rd = 0; | ||
338 | + | ||
339 | + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | ||
340 | + glMatrixMode(GL_PROJECTION); | ||
341 | + glLoadIdentity(); | ||
342 | + gluPerspective(10, 1, 1, 200); | ||
343 | + glTranslatef(t[0], t[1] - 2, t[2] - 30); | ||
344 | + glScalef(1, 1, 1); | ||
345 | + | ||
346 | + glEnable(GL_LIGHTING); | ||
347 | + glEnable(GL_LIGHT0); | ||
348 | + | ||
349 | + // 색이 보이도록 빛을 추가함 | ||
350 | + GLfloat diffuse0[4] = { 1.0, 1.0, 1.0, 1.0 }; | ||
351 | + GLfloat ambient0[4] = { 5.0, 5.0, 5.0, 1.0 }; | ||
352 | + GLfloat specular0[4] = { 1.0, 1.0, 1.0, 1.0 }; | ||
353 | + GLfloat light0_pos[4] = { 2.0, 2.0, 2.0, 1.0 }; | ||
354 | + | ||
355 | + glLightfv(GL_LIGHT0, GL_POSITION, light0_pos); | ||
356 | + glLightfv(GL_LIGHT0, GL_AMBIENT, ambient0); | ||
357 | + glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse0); | ||
358 | + glLightfv(GL_LIGHT0, GL_SPECULAR, specular0); | ||
359 | + | ||
360 | + glEnable(GL_TEXTURE_2D); | ||
361 | + glTexImage2D(GL_TEXTURE_2D, 0, 3, 2048, 2048, 0, GL_RGB, GL_UNSIGNED_BYTE, mytexels); | ||
362 | + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); | ||
363 | + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); | ||
364 | + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | ||
365 | + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | ||
366 | + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | ||
367 | + | ||
368 | + GLfloat m[4][4],m1[4][4]; | ||
369 | + build_rotmatrix(m, quat); | ||
370 | + | ||
371 | + m1[0][0] = 1.0f; | ||
372 | + m1[0][1] = 0.0f; | ||
373 | + m1[0][2] = -0.3f; | ||
374 | + m1[0][3] = 0.0f; | ||
375 | + | ||
376 | + m1[1][0] = 0.0f;; | ||
377 | + m1[1][1] = 1.0f; | ||
378 | + m1[1][2] = 0.3f; | ||
379 | + m1[1][3] = 0.0f; | ||
380 | + | ||
381 | + m1[2][0] = 0.0f; | ||
382 | + m1[2][1] = 0.0f; | ||
383 | + m1[2][2] = 1.0f; | ||
384 | + m1[2][3] = 0.0f; | ||
385 | + | ||
386 | + m1[3][0] = 0.0f; | ||
387 | + m1[3][1] = 0.0f; | ||
388 | + m1[3][2] = 0.0f; | ||
389 | + m1[3][3] = 1.0f; | ||
390 | + | ||
391 | + glMultMatrixf(&m[0][0]); | ||
392 | + glMatrixMode(GL_PROJECTION); | ||
393 | + | ||
394 | + glBegin(GL_QUADS); | ||
395 | + | ||
396 | + // 실제 사과를 그리는 부분의 로직 | ||
397 | + for (register int j = 0; j < face_n; ++j) { | ||
398 | + for (int i = 0; i < 4; ++i) { | ||
399 | + f(i, j); | ||
400 | + } | ||
401 | + } | ||
402 | + glEnd(); | ||
403 | + glutSwapBuffers(); | ||
404 | +} | ||
405 | + | ||
406 | +// 좌표 하나를 준비하는 과정 | ||
407 | +inline void f(int i, int j) { | ||
408 | + // 인덱스가 1을 기준으로 시작하기 때문에 보정함 | ||
409 | + int vidx = face[j * 4 + i].index_1 - 1; | ||
410 | + int vtidx = face[j * 4 + i].index_2 - 1; | ||
411 | + int vnidx = face[j * 4 + i].index_3 - 1; | ||
412 | + | ||
413 | + glTexCoord2d(vt[vtidx].X, vt[vtidx].Y); | ||
414 | + glVertex3f(vertex[vidx].X, vertex[vidx].Y, vertex[vidx].Z); | ||
415 | + | ||
416 | + // 왜 있는지 모르겠음 | ||
417 | + glNormal3f(vn[vnidx].X, vn[vnidx].Y, vn[vnidx].Z); | ||
418 | +} | ||
419 | + | ||
420 | +int main(int argc, char* argv[]) { | ||
421 | + vertex = new Vertex[100000]; | ||
422 | + vertex_color = new Vertex[100000]; | ||
423 | + vt = new Vertex[100000]; | ||
424 | + vn = new Vertex[100000]; | ||
425 | + face = new Vertex[100000]; | ||
426 | + | ||
427 | + FILE* fp; | ||
428 | + fp = fopen("apple.obj", "r"); | ||
429 | + int count = 0; | ||
430 | + char ch; | ||
431 | + float x, y, z; | ||
432 | + | ||
433 | + // point 로드 | ||
434 | + for (register int j = 0; j < 1000000; ++j) { | ||
435 | + count = fscanf(fp, "%c %f %f %f\n", &ch, &x, &y, &z); | ||
436 | + if (count == 4 && ch == 'v') { | ||
437 | + vertex[j].X = x / scale; | ||
438 | + vertex[j].Y = y / scale; | ||
439 | + vertex[j].Z = z / scale; | ||
440 | + } else { | ||
441 | + break; | ||
442 | + } | ||
443 | + } | ||
444 | + | ||
445 | + fclose(fp); | ||
446 | + | ||
447 | + // 텍스쳐 로드 | ||
448 | + fp = fopen("applet.bmp", "rb"); | ||
449 | + unsigned char info[54]; | ||
450 | + | ||
451 | + fread(info, sizeof(unsigned char), 54, fp); | ||
452 | + int width = *(int*)&info[18]; | ||
453 | + int height = *(int*)&info[22]; | ||
454 | + int size = 3 * width * height; | ||
455 | + unsigned char* data = new unsigned char[size]; | ||
456 | + | ||
457 | + printf("%d %d %d", width, height, size); | ||
458 | + | ||
459 | + fread(data, sizeof(unsigned char), size, fp); | ||
460 | + int k = 0; | ||
461 | + | ||
462 | + for (int i = 0; i < width; i++) { | ||
463 | + for (int j = 0; j < height; j++) { | ||
464 | + mytexels[j][i][0] = data[k * 3 + 2]; | ||
465 | + mytexels[j][i][1] = data[k * 3 + 1]; | ||
466 | + mytexels[j][i][2] = data[k * 3]; | ||
467 | + k++; | ||
468 | + } | ||
469 | + } | ||
470 | + | ||
471 | + fclose(fp); | ||
472 | + | ||
473 | + fp = fopen("applef2.txt", "rb"); | ||
474 | + | ||
475 | + Vertex idx[4]; | ||
476 | + | ||
477 | + // face 정보 로드 | ||
478 | + for (register int j = 0; j < 100000; j = j + 1) { | ||
479 | + | ||
480 | + count = fscanf(fp, "%c %d/%d/%d %d/%d/%d %d/%d/%d %d/%d/%d\n", &ch, | ||
481 | + &idx[0].index_1, &idx[0].index_2, &idx[0].index_3, | ||
482 | + &idx[1].index_1, &idx[1].index_2, &idx[1].index_3, | ||
483 | + &idx[2].index_1, &idx[2].index_2, &idx[2].index_3, | ||
484 | + &idx[3].index_1, &idx[3].index_2, &idx[3].index_3); | ||
485 | + if (count == -1) { | ||
486 | + break; | ||
487 | + } | ||
488 | + | ||
489 | + face_n++; | ||
490 | + face[j * 4 + 0] = idx[0]; | ||
491 | + face[j * 4 + 1] = idx[1]; | ||
492 | + face[j * 4 + 2] = idx[2]; | ||
493 | + face[j * 4 + 3] = idx[3]; | ||
494 | + | ||
495 | + } | ||
496 | + | ||
497 | + fclose(fp); | ||
498 | + | ||
499 | + // 텍스쳐 좌표, 노멀 로드 | ||
500 | + fp = fopen("applet.txt", "rb"); | ||
501 | + | ||
502 | + for (register int j = 0; j < 100000; j = j + 1) { | ||
503 | + char c0; | ||
504 | + char c1; | ||
505 | + | ||
506 | + float x, y, z; | ||
507 | + | ||
508 | + count = fscanf(fp, "%c%c %f %f %f\n", &c0, &c1, &x, &y, &z); | ||
509 | + | ||
510 | + if (c0 == 'v' && c1 == 't') { | ||
511 | + vt[j].X = x; | ||
512 | + vt[j].Y = y; | ||
513 | + } else if (c0 == 'v' && c1 == 'n') { | ||
514 | + vn[j].X = x; | ||
515 | + vn[j].Y = y; | ||
516 | + vn[j].Z = z; | ||
517 | + } | ||
518 | + } | ||
519 | + | ||
520 | + fclose(fp); | ||
521 | + | ||
522 | + InitializeWindow(argc, argv); | ||
523 | + | ||
524 | + display(); | ||
525 | + | ||
526 | + glutMainLoop(); | ||
527 | + delete[] vertex; | ||
528 | + delete[] vertex_color; | ||
529 | + delete[] vt; | ||
530 | + delete[] vn; | ||
531 | + return 0; | ||
532 | +} |
-
Please register or login to post a comment