├── .gitattributes
├── .gitignore
├── Assembler.filters
├── Assembler.vcxproj
├── Documents
├── CPUID AMD Specs.pdf
├── CPUID INTEL Specs.pdf
├── DevIL Manual.pdf
├── DevIL Reference Guide.pdf
└── OpenGL Programming Guide - Red Book.pdf
├── OpenGLDemos.csproj
├── OpenGLDotNet.csproj
├── OpenGLDotNet.sln
├── Properties
├── OpenGLDemos.AssemblyInfo.cs
└── OpenGLDotNet.AssemblyInfo.cs
├── README.md
├── Reference
├── opengl46_20180508_glcorearb.h
├── opengl46_20180508_glext.h
├── opengl46_20180508_glxext.h
└── opengl46_20180508_wglext.h
├── Source
├── Assembler
│ ├── assembler.c
│ └── types.h
├── Common
│ └── Common.cs
├── Demos
│ ├── Q2CommandManager.cs
│ ├── Q2ConsoleMain.cs
│ ├── Q2ConsoleManager.cs
│ ├── Q2ConsoleVarManager.cs
│ └── Q2TextureManager.cs
├── Imaging
│ ├── IL.Constants.cs
│ ├── IL.Functions.cs
│ ├── IL.Wrappers.cs
│ ├── ILU.Constants.cs
│ ├── ILU.Functions.cs
│ ├── ILU.Types.cs
│ ├── ILU.Wrappers.cs
│ ├── ILUT.Constants.cs
│ ├── ILUT.Functions.cs
│ ├── ILUT.Types.cs
│ └── ILUT.Wrappers.cs
├── Math
│ └── OpenGLDotNet.Math.cs
├── OpenGL
│ ├── FG.Constants.cs
│ ├── FG.Functions.cs
│ ├── FG.Wrappers.cs
│ ├── GL.Base.cs
│ ├── GL.CoreConstants.cs
│ ├── GL.CoreDelegates.cs
│ ├── GL.CoreLinker.cs
│ ├── GL.CoreWrappers.cs
│ ├── GL.ExtConstants.cs
│ ├── GL.ExtDelegates.cs
│ ├── GL.ExtLinker.cs
│ ├── GL.ExtWrappers.cs
│ ├── GLU.Constants.cs
│ ├── GLU.Functions.cs
│ ├── GLU.Wrappers.cs
│ ├── GLUT.Constants.cs
│ ├── GLUT.Functions.cs
│ ├── GLUT.Wrappers.cs
│ ├── WGL.Base.cs
│ ├── WGL.CoreConstants.cs
│ ├── WGL.CoreDelegates.cs
│ ├── WGL.CoreLinker.cs
│ ├── WGL.CoreTypes.cs
│ ├── WGL.CoreWrappers.cs
│ ├── WGL.ExtConstants.cs
│ ├── WGL.ExtDelegates.cs
│ ├── WGL.ExtLinker.cs
│ └── WGL.ExtWrappers.cs
├── Platform
│ ├── CPUInfo.cs
│ └── Windows.cs
└── app.config
├── app.config
└── bin
├── Debug
├── DevIL.dll
├── ILU.dll
├── ILUT.dll
├── NAudio.WindowsMediaFormat.dll
├── NAudio.dll
├── NAudio.xml
├── data
│ ├── cm_back.jpg
│ ├── cm_xneg.jpg
│ ├── cm_xpos.jpg
│ ├── cm_yneg.jpg
│ ├── cm_ypos.jpg
│ ├── cm_zneg.jpg
│ ├── cm_zpos.jpg
│ ├── colormap.pcx
│ ├── conback.png
│ ├── conback2.jpg
│ └── conchars.png
├── freeglut.dll
├── glut32.dll
└── glut32.old.dll
└── Release
├── Assembler.dll
├── Assembler.lib
├── DevIL.dll
├── ILU.dll
├── ILUT.dll
├── NAudio.WindowsMediaFormat.dll
├── NAudio.dll
├── OpenGLDemos.exe
├── OpenGLDemos.exe.config
├── OpenGLDotNet.dll
├── OpenGLDotNet.dll.config
├── data
├── cm_back.jpg
├── cm_xneg.jpg
├── cm_xpos.jpg
├── cm_yneg.jpg
├── cm_ypos.jpg
├── cm_zneg.jpg
├── cm_zpos.jpg
├── colormap.pcx
├── conback.png
├── conback2.jpg
└── conchars.png
├── freeglut.dll
├── glut32.dll
└── glut32.old.dll
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | *.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | *.sln merge=binary
26 | *.csproj merge=binary
27 | *.vbproj merge=binary
28 | *.vcxproj merge=binary
29 | *.vcproj merge=binary
30 | *.dbproj merge=binary
31 | *.fsproj merge=binary
32 | *.lsproj merge=binary
33 | *.wixproj merge=binary
34 | *.modelproj merge=binary
35 | *.sqlproj merge=binary
36 | *.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | *.jpg binary
44 | *.png binary
45 | *.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | *.pdf diff=astextplain
55 | *.PDF diff=astextplain
56 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # This .gitignore file was automatically created by Microsoft(R) Visual Studio.
3 | ################################################################################
4 |
5 | /OpenGLDotNet.VC.db
6 | /OpenGLDotNet.VC.VC.opendb
7 | *.suo
8 | *.user
9 | *.sdf
10 | *.exp
11 | *.iobj
12 | *.ipdb
13 | *.pdb
14 | /bin/debug/
15 | /debug/
16 | /release/
17 | obj/
18 | .git/
19 | .vs/
20 |
--------------------------------------------------------------------------------
/Assembler.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Assembler.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 |
14 | {2264A801-DD54-4621-B983-2861E77ED3D4}
15 | Win32Proj
16 | Assembler
17 | Assembler
18 | 8.1
19 |
20 |
21 |
22 | DynamicLibrary
23 | true
24 | Unicode
25 | v141_xp
26 | true
27 |
28 |
29 | DynamicLibrary
30 | false
31 | true
32 | Unicode
33 | v141_xp
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | false
47 | $(SolutionDir)bin\$(Configuration)\
48 |
49 |
50 | false
51 | $(SolutionDir)bin\$(Configuration)\
52 |
53 |
54 |
55 |
56 |
57 | Level3
58 | Disabled
59 | WIN32;_DEBUG;_WINDOWS;_USRDLL;CPUID_EXPORTS;%(PreprocessorDefinitions)
60 |
61 |
62 | Windows
63 | true
64 |
65 |
66 |
67 |
68 | Level3
69 |
70 |
71 | MaxSpeed
72 | true
73 | true
74 | WIN32;NDEBUG;_WINDOWS;_USRDLL;CPUID_EXPORTS;%(PreprocessorDefinitions)
75 |
76 |
77 | Windows
78 | true
79 | true
80 | true
81 |
82 |
83 |
84 |
85 | ProgramDatabase
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/Documents/CPUID AMD Specs.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/Documents/CPUID AMD Specs.pdf
--------------------------------------------------------------------------------
/Documents/CPUID INTEL Specs.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/Documents/CPUID INTEL Specs.pdf
--------------------------------------------------------------------------------
/Documents/DevIL Manual.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/Documents/DevIL Manual.pdf
--------------------------------------------------------------------------------
/Documents/DevIL Reference Guide.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/Documents/DevIL Reference Guide.pdf
--------------------------------------------------------------------------------
/Documents/OpenGL Programming Guide - Red Book.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/Documents/OpenGL Programming Guide - Red Book.pdf
--------------------------------------------------------------------------------
/OpenGLDemos.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | x86
6 | 8.0.30703
7 | 2.0
8 | {46B3BD7D-C426-4890-8D50-B1D7AC2202B7}
9 | Exe
10 | Properties
11 | OpenGLDemos
12 | OpenGLDemos
13 | v3.5
14 | 512
15 | publish\
16 | true
17 | Disk
18 | false
19 | Foreground
20 | 7
21 | Days
22 | false
23 | false
24 | true
25 | 0
26 | 1.0.0.%2a
27 | false
28 | false
29 | true
30 |
31 |
32 | x86
33 | true
34 | full
35 | false
36 | bin\Debug\
37 | DEBUG;TRACE
38 | prompt
39 | 4
40 | AllRules.ruleset
41 | true
42 |
43 |
44 | x86
45 | none
46 | true
47 | bin\Release\
48 | TRACE
49 | prompt
50 | 4
51 | true
52 | false
53 |
54 |
55 | Quake2DotNet.Quake2Main
56 |
57 |
58 |
59 |
60 | D:\Development\Windows\Projects\Quake2DotNet\bin\Release\NAudio.dll
61 |
62 |
63 | D:\Development\Windows\Projects\Quake2DotNet\bin\Release\NAudio.WindowsMediaFormat.dll
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | {51991C31-1314-4726-9544-D37E228F5D60}
81 | OpenGLDotNet
82 |
83 |
84 |
85 |
86 | False
87 | .NET Framework 3.5 SP1
88 | true
89 |
90 |
91 |
92 |
93 | Designer
94 |
95 |
96 |
97 |
104 |
--------------------------------------------------------------------------------
/OpenGLDotNet.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | x86
6 | 8.0.30703
7 | 2.0
8 | {51991C31-1314-4726-9544-D37E228F5D60}
9 | Library
10 | Properties
11 | OpenGLDotNet
12 | OpenGLDotNet
13 | v3.5
14 |
15 |
16 | 512
17 | false
18 | publish\
19 | true
20 | Disk
21 | false
22 | Foreground
23 | 7
24 | Days
25 | false
26 | false
27 | true
28 | 0
29 | 1.0.0.%2a
30 | false
31 | true
32 |
33 |
34 | x86
35 | true
36 | full
37 | false
38 | bin\Debug\
39 | DEBUG;TRACE
40 | prompt
41 | 4
42 | true
43 | AllRules.ruleset
44 |
45 |
46 | x86
47 | none
48 | true
49 | bin\Release\
50 | TRACE
51 | prompt
52 | 4
53 | true
54 | false
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 | False
118 | .NET Framework 3.5 SP1 Client Profile
119 | false
120 |
121 |
122 | False
123 | .NET Framework 3.5 SP1
124 | true
125 |
126 |
127 | False
128 | Windows Installer 3.1
129 | true
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 | Designer
138 |
139 |
140 |
141 |
148 |
--------------------------------------------------------------------------------
/OpenGLDotNet.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio 14
3 | VisualStudioVersion = 14.0.25123.0
4 | MinimumVisualStudioVersion = 10.0.40219.1
5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGLDotNet", "OpenGLDotNet.csproj", "{51991C31-1314-4726-9544-D37E228F5D60}"
6 | ProjectSection(ProjectDependencies) = postProject
7 | {2264A801-DD54-4621-B983-2861E77ED3D4} = {2264A801-DD54-4621-B983-2861E77ED3D4}
8 | EndProjectSection
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGLDemos", "OpenGLDemos.csproj", "{46B3BD7D-C426-4890-8D50-B1D7AC2202B7}"
11 | ProjectSection(ProjectDependencies) = postProject
12 | {2264A801-DD54-4621-B983-2861E77ED3D4} = {2264A801-DD54-4621-B983-2861E77ED3D4}
13 | EndProjectSection
14 | EndProject
15 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Assembler", "Assembler.vcxproj", "{2264A801-DD54-4621-B983-2861E77ED3D4}"
16 | EndProject
17 | Global
18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
19 | Debug|Mixed Platforms = Debug|Mixed Platforms
20 | Debug|Win32 = Debug|Win32
21 | Debug|x86 = Debug|x86
22 | Release|Mixed Platforms = Release|Mixed Platforms
23 | Release|Win32 = Release|Win32
24 | Release|x86 = Release|x86
25 | EndGlobalSection
26 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
27 | {51991C31-1314-4726-9544-D37E228F5D60}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
28 | {51991C31-1314-4726-9544-D37E228F5D60}.Debug|Mixed Platforms.Build.0 = Debug|x86
29 | {51991C31-1314-4726-9544-D37E228F5D60}.Debug|Win32.ActiveCfg = Debug|x86
30 | {51991C31-1314-4726-9544-D37E228F5D60}.Debug|x86.ActiveCfg = Debug|x86
31 | {51991C31-1314-4726-9544-D37E228F5D60}.Debug|x86.Build.0 = Debug|x86
32 | {51991C31-1314-4726-9544-D37E228F5D60}.Release|Mixed Platforms.ActiveCfg = Release|x86
33 | {51991C31-1314-4726-9544-D37E228F5D60}.Release|Mixed Platforms.Build.0 = Release|x86
34 | {51991C31-1314-4726-9544-D37E228F5D60}.Release|Win32.ActiveCfg = Release|x86
35 | {51991C31-1314-4726-9544-D37E228F5D60}.Release|x86.ActiveCfg = Release|x86
36 | {51991C31-1314-4726-9544-D37E228F5D60}.Release|x86.Build.0 = Release|x86
37 | {46B3BD7D-C426-4890-8D50-B1D7AC2202B7}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
38 | {46B3BD7D-C426-4890-8D50-B1D7AC2202B7}.Debug|Mixed Platforms.Build.0 = Debug|x86
39 | {46B3BD7D-C426-4890-8D50-B1D7AC2202B7}.Debug|Win32.ActiveCfg = Debug|x86
40 | {46B3BD7D-C426-4890-8D50-B1D7AC2202B7}.Debug|x86.ActiveCfg = Debug|x86
41 | {46B3BD7D-C426-4890-8D50-B1D7AC2202B7}.Debug|x86.Build.0 = Debug|x86
42 | {46B3BD7D-C426-4890-8D50-B1D7AC2202B7}.Release|Mixed Platforms.ActiveCfg = Release|x86
43 | {46B3BD7D-C426-4890-8D50-B1D7AC2202B7}.Release|Mixed Platforms.Build.0 = Release|x86
44 | {46B3BD7D-C426-4890-8D50-B1D7AC2202B7}.Release|Win32.ActiveCfg = Release|x86
45 | {46B3BD7D-C426-4890-8D50-B1D7AC2202B7}.Release|x86.ActiveCfg = Release|x86
46 | {46B3BD7D-C426-4890-8D50-B1D7AC2202B7}.Release|x86.Build.0 = Release|x86
47 | {2264A801-DD54-4621-B983-2861E77ED3D4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
48 | {2264A801-DD54-4621-B983-2861E77ED3D4}.Debug|Mixed Platforms.Build.0 = Debug|Win32
49 | {2264A801-DD54-4621-B983-2861E77ED3D4}.Debug|Win32.ActiveCfg = Debug|Win32
50 | {2264A801-DD54-4621-B983-2861E77ED3D4}.Debug|Win32.Build.0 = Debug|Win32
51 | {2264A801-DD54-4621-B983-2861E77ED3D4}.Debug|x86.ActiveCfg = Release|Win32
52 | {2264A801-DD54-4621-B983-2861E77ED3D4}.Release|Mixed Platforms.ActiveCfg = Release|Win32
53 | {2264A801-DD54-4621-B983-2861E77ED3D4}.Release|Mixed Platforms.Build.0 = Release|Win32
54 | {2264A801-DD54-4621-B983-2861E77ED3D4}.Release|Win32.ActiveCfg = Release|Win32
55 | {2264A801-DD54-4621-B983-2861E77ED3D4}.Release|Win32.Build.0 = Release|Win32
56 | {2264A801-DD54-4621-B983-2861E77ED3D4}.Release|x86.ActiveCfg = Release|Win32
57 | EndGlobalSection
58 | GlobalSection(SolutionProperties) = preSolution
59 | HideSolutionNode = FALSE
60 | EndGlobalSection
61 | EndGlobal
62 |
--------------------------------------------------------------------------------
/Properties/OpenGLDemos.AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenGLDemos")]
9 | [assembly: AssemblyDescription("OpenGL Demos for OpenGLDotNet")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Taylan Inan")]
12 | [assembly: AssemblyProduct("OpenGLDemos")]
13 | [assembly: AssemblyCopyright("Copyright © 2014-2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("c6891fc0-4b13-4343-80dc-caf41f5bc745")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | [assembly: AssemblyVersion("1.1.3.0")]
33 | [assembly: AssemblyFileVersion("1.1.3.0")]
34 |
--------------------------------------------------------------------------------
/Properties/OpenGLDotNet.AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OpenGLDotNet")]
9 | [assembly: AssemblyDescription("OpenGL Wrappers for C# Language")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Taylan Inan")]
12 | [assembly: AssemblyProduct("OpenGLDotNet")]
13 | [assembly: AssemblyCopyright("Copyright © 2014-2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("f78658c5-046b-4d43-acfb-8f87e1564ce1")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.1.3.0")]
36 | [assembly: AssemblyFileVersion("1.1.3.0")]
37 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # OpenGLDotNet v1.1.1
2 | # C# Language Bindings for OpenGL 4.5
3 |
4 | OpenGL DotNet is a set of libraries and wrappers especially written for C# in order to make 3D OpenGL programming much easier. It is a base consisting of several libraries; on top of these libraries you can build your own 3D game engine and/or make much simpler 3D demos.
5 |
6 | OpenGL DotNet supports OpenGL version up to 4.5 (latest version as of April 2016), and over 610+ OpenGL extensions.
7 |
8 | OpenGL DotNet consists of several C# classes, C# libraries and C# wrappers for existing projects written in C/C++. It is completely written from scratch in over 3 months with OpenGL in mind with extensive research and painfully attention given to the details. As far as I know it is the first C# project for OpenGL, which supports over 610+ extensions. Technically you can write Battle Field 4 (or 5) with that much features in C#, but the C#’s performance can suffer compared to pure C/C++ implementations. The main goal of this project is to help you get started quickly with OpenGL programming with a feature-rich, robust, clean framework.
9 |
10 | # Overview
11 | The following classes/libraries/wrappers can be found in OpenGLDotNet namespace:
12 |
13 | OpenGL/GLConfig : Helps you initialize the OpenGL rendering context with version selection (backwards- or forward-compatible or core-profile) and builds a text log while initializing. Also keeps track of supported OpenGL Extensions.
14 |
15 | OpenGL/GL & WGL : They are the main classes for dynamically loading, linking and using of OpenGL Core and Extension functions starting with “gl” and “wgl” respectively. [for example: “glBegin(GL_QUADS);” is written as “GL.Begin(GL.GL_QUADS);” the same applies for WGL functions]
16 |
17 | OpenGL/GLU : Open(GL) (U)tility is included in Windows as default and is supported by OpenGL Dotnet with a wrapper library.
18 |
19 | OpenGL/GLUT & FREEGLUT : Open(GL) (U)tility (T)oolkit (which is actually very useful, but old) and free and more-update version of it, FREEGLUT, is also supported by OpenGL DotNet with a wrapper library.
20 |
21 | Math/OpenGLDotNet.Math : Is a set of object-oriented classes, which help you with Vector and Matrix operations along with other primitives like Point, Rectangle, Circle, Sphere etc…
22 |
23 | Assembler : Is a simple, short C/C++ source code showing how to use assembler to write functions in a DLL (mostly for [CPUID instruction](http://en.wikipedia.org/wiki/CPUID), which gives detailed information about the processor) and after that importing and using these functions in C#.
24 |
25 | Platform/CPUInfo : Is a class with the aim of giving detailed CPU Information (Processor Vendor, Speed, Name, supported instruction sets and features etc…), so that use of necessary optimizations (mostly instruction sets like [SSE2](http://en.wikipedia.org/wiki/SSE2) or [SSE3](http://en.wikipedia.org/wiki/SSE3)) can be decided later at run-time.
26 |
27 | Imaging/DevIL : Is the main imaging DLL written in C/C++ for speed. DevIL is a acronym for “Developer's Image Library”. The original project website can be found [here](http://openil.sourceforge.net/). It allows loading and saving of a lot different picture/image types and uploading them as textures to the OpenGL.
28 |
29 | Imaging/ILU & ILUT : ILU is (I)mage (L)ibrary Utility and ILUT is (I)mage (L)ibrary (U)tility (T)oolkit of DevIL, the Developer's Image Library.
30 |
31 | # Version History
32 | v1.1.1
33 | This is the third public release of OpenGLDotNet, which is updated with "[SuppressUnmanagedCodeSecurity]" attribute for delegates & methods to improve performance. "CPUInfo" class has been also updated to process and show more instruction sets and features.
34 |
35 | v1.1.0
36 | This is the second public release of OpenGLDotNet, which is updated to support OpenGL v4.5 with over 610+ extensions as of April 2016. Also some new demos (like Quake 2 Console demo and others) have been added to the release.
37 |
38 | v1.0.0
39 | This is the initial public release of OpenGLDotNet, which supports up to OpenGL v4.4 with over 550+ extensions as of March 2014.
40 |
--------------------------------------------------------------------------------
/Source/Assembler/assembler.c:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : assembler.c
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : All assembler routines are written in this file and imported and
6 | // used by the CSharp functions later.
7 | // WEB : https://github.com/carmack78/opengldotnet
8 | // AUTHOR : TAYLAN INAN
9 | // E-MAIL : taylaninan@yahoo.com
10 | // DATE : 2014-2018
11 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
12 | // ----------------------------------------------------------------------------
13 |
14 | #include "types.h"
15 |
16 | uint32 _eax = 0;
17 | uint32 _ebx = 0;
18 | uint32 _ecx = 0;
19 | uint32 _edx = 0;
20 |
21 | __declspec(dllexport) void __stdcall _cpuid(uint32 function, uint32 subfunction)
22 | {
23 | __asm
24 | {
25 | pusha
26 | mov eax, function
27 | mov ecx, subfunction
28 | cpuid
29 | mov _eax, eax
30 | mov _ebx, ebx
31 | mov _ecx, ecx
32 | mov _edx, edx
33 | popa
34 | };
35 | }
36 |
37 | // Return 64bit counter in EDX:EAX
38 | __declspec(dllexport) void __stdcall _rdtsc()
39 | {
40 | __asm
41 | {
42 | pusha
43 | rdtsc
44 | mov _edx, edx
45 | mov _eax, eax
46 | popa
47 | }
48 | }
49 |
50 | __declspec(dllexport) uint32 __stdcall _reg_eax()
51 | {
52 | return _eax;
53 | }
54 |
55 | __declspec(dllexport) uint32 __stdcall _reg_ebx()
56 | {
57 | return _ebx;
58 | }
59 |
60 | __declspec(dllexport) uint32 __stdcall _reg_ecx()
61 | {
62 | return _ecx;
63 | }
64 |
65 | __declspec(dllexport) uint32 __stdcall _reg_edx()
66 | {
67 | return _edx;
68 | }
69 |
--------------------------------------------------------------------------------
/Source/Assembler/types.h:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : types.h
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : Some type declarations to be used by "assembler.c" later. This
6 | // file included by "assembler.c".
7 | // WEB : https://github.com/carmack78/opengldotnet
8 | // AUTHOR : TAYLAN INAN
9 | // E-MAIL : taylaninan@yahoo.com
10 | // DATE : 2014-2018
11 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
12 | // ----------------------------------------------------------------------------
13 |
14 | typedef unsigned char uint8;
15 | typedef signed char int8;
16 | typedef unsigned short uint16;
17 | typedef signed short int16;
18 | typedef unsigned int uint32;
19 | typedef signed int int32;
20 | typedef unsigned long long uint64;
21 | typedef signed long long int64;
22 |
23 | typedef float f32;
24 | typedef double f64;
25 | typedef long double f96;
26 |
--------------------------------------------------------------------------------
/Source/Demos/Q2CommandManager.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : q2commandmanager.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : This file is part of Quake 2 Console Demo. The Q2CommandManager
6 | // allows of adding and executing console commands. Try writing "help"
7 | // on console to list available commands and explanations.
8 | // WEB : https://github.com/carmack78/opengldotnet
9 | // AUTHOR : TAYLAN INAN
10 | // E-MAIL : taylaninan@yahoo.com
11 | // DATE : 2014-2018
12 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
13 | // ----------------------------------------------------------------------------
14 |
15 | using System;
16 | using System.Collections.Generic;
17 | using System.IO;
18 | using OpenGLDotNet;
19 | using NAudio;
20 | using NAudio.Wave;
21 |
22 | namespace Quake2DotNet
23 | {
24 | public delegate void TCALLBACKCommandProc(string[] Parameters);
25 |
26 | public class CommandNode
27 | {
28 | public string Name = null;
29 | public byte ParamCount = 0;
30 | public string Help = null;
31 | public TCALLBACKCommandProc CommandProc = null;
32 | }
33 |
34 | public static class CommandManager
35 | {
36 | private static SortedDictionary Commands = new SortedDictionary();
37 | private static IWavePlayer waveOutDevice;
38 | private static AudioFileReader audioFileReader;
39 |
40 | public static void Init()
41 | {
42 | AddCommand("cmdlist", 0, "Lists available commands", Command_cmdlist);
43 | AddCommand("help", 0, "Lists available commands", Command_cmdlist);
44 | AddCommand("exit", 0, "Exits/Quits the Quake2DotNet", Command_exit);
45 | AddCommand("quit", 0, "Exits/Quits the Quake2DotNet", Command_exit);
46 | AddCommand("openglinfo", 0, "Displays short OpenGL information", Command_openglinfo);
47 | AddCommand("cpuinfo", 0, "Displays detailed CPU information", Command_cpuinfo);
48 | AddCommand("version", 0, "Displays current Quake2DotNet information", Command_version);
49 | AddCommand("dumpconsole", 1, "Dumps all the information in console to a text file", Command_dumpconsole);
50 | AddCommand("playmusic", 1, "Plays the specified music file", Command_playmusic);
51 | AddCommand("stopmusic", 0, "Stops the currently playing music", Command_stopmusic);
52 | AddCommand("background", 1, "Changes the console background image", Command_background);
53 | AddCommand("imagelist", 0, "Displays detailed texture information, which are uploaded to the GPU", Command_imagelist);
54 | AddCommand("demofreeglut", 0, "When console is closed, displays the FREEGLUT demo with simple objects", Command_demofreeglut);
55 | AddCommand("democubemapping", 0, "When console is closed, displays the CUBEMAPPING demo", Command_democubemapping);
56 | AddCommand("demogui", 0, "When console is closed, displays the GUI demo", Command_demogui);
57 | // Required for audio out and the MP3 stream
58 | waveOutDevice = new WaveOut();
59 |
60 | //audioFileReader = new AudioFileReader(@"Music\" + ConsoleVarManager.GetValueToString("MusicTrack"));
61 | //waveOutDevice.Init(audioFileReader);
62 |
63 | //waveOutDevice.Play();
64 | }
65 |
66 | private static void AddCommand(string CommandName, byte ArgumentCount, string CommandHelp, TCALLBACKCommandProc CommandProc)
67 | {
68 | if (!String.IsNullOrEmpty(CommandName))
69 | {
70 | string[] CommandWithParameters = Tokenize(CommandName);
71 | CommandName = CommandWithParameters[0];
72 |
73 | if (!Commands.ContainsKey(CommandName))
74 | {
75 | CommandNode Node = new CommandNode();
76 |
77 | Node.Name = CommandName;
78 | Node.ParamCount = ArgumentCount;
79 | Node.Help = CommandHelp;
80 | Node.CommandProc = CommandProc;
81 |
82 | Commands.Add(CommandName, Node);
83 | }
84 | }
85 | }
86 |
87 | public static void ExecuteCommand(string CommandLine)
88 | {
89 | CommandLine = CommandStandardization(CommandLine);
90 |
91 | if (!String.IsNullOrEmpty(CommandLine))
92 | {
93 | string[] CommandWithParameters = Tokenize(CommandLine);
94 | string CommandName = CommandWithParameters[0];
95 | string[] Parameters = null;
96 |
97 | // If the command with its parameters presents
98 | if (CommandWithParameters.Length > 1)
99 | {
100 | Parameters = new string[CommandWithParameters.Length - 1];
101 |
102 | for (ushort Counter = 1; Counter < CommandWithParameters.Length; Counter++)
103 | {
104 | Parameters[Counter - 1] = CommandWithParameters[Counter];
105 | }
106 | }
107 |
108 | if (Commands.ContainsKey(CommandName))
109 | {
110 | CommandNode Node = Commands[CommandName];
111 |
112 | if (Node.CommandProc != null)
113 | {
114 | Node.CommandProc(Parameters);
115 | }
116 | else
117 | {
118 | ConsoleManager.WriteLine("Error! Command delegate not defined!");
119 | }
120 | }
121 | else
122 | {
123 | ConsoleManager.WriteLine("Error! Invalid command!");
124 | }
125 | }
126 | }
127 |
128 | private static string CommandStandardization(string Command)
129 | {
130 | // Remove console input characters "> " from the beginning
131 | if (Command.StartsWith("> "))
132 | {
133 | Command = Command.Substring(2).Trim();
134 | }
135 | if (Command.StartsWith(">"))
136 | {
137 | Command = Command.Substring(1).Trim();
138 | }
139 |
140 | // Remove whitespace
141 | while (Command.IndexOf(" ") > 0)
142 | {
143 | Command = Command.Replace(" ", " ");
144 | }
145 |
146 | Command = Command.ToLower();
147 |
148 | return Command;
149 | }
150 |
151 | private static string[] Tokenize(string Command)
152 | {
153 | string[] Tokens = CommandStandardization(Command).Split(' ');
154 |
155 | for (ushort Counter = 0; Counter < Tokens.Length; Counter++)
156 | {
157 | Tokens[Counter] = Tokens[Counter].Trim();
158 | }
159 |
160 | return Tokens;
161 | }
162 |
163 | private static void Command_cmdlist(string[] parameters)
164 | {
165 | ConsoleManager.WriteLine();
166 | ConsoleManager.WriteLine("Listing available commands...");
167 | ConsoleManager.WriteLine("================================================================================");
168 |
169 | foreach (CommandNode Node in Commands.Values)
170 | {
171 | ConsoleManager.WriteLine(Node.Name.PadRight(16, ' ') + " --> " + Node.Help);
172 | }
173 | }
174 |
175 | private static void Command_exit(string[] parameters)
176 | {
177 | FG.LeaveMainLoop();
178 | }
179 |
180 | private static void Command_openglinfo(string[] parameters)
181 | {
182 | string vendor = GL.GetString(GL.GL_VENDOR).Trim();
183 | string version = GL.GetString(GL.GL_VERSION).Trim();
184 | string renderer = GL.GetString(GL.GL_RENDERER).Trim();
185 | string shader = GL.GetString(GL.GL_SHADING_LANGUAGE_VERSION).Trim();
186 |
187 | ConsoleManager.WriteLine();
188 | ConsoleManager.WriteLine("OpenGL information...");
189 | ConsoleManager.WriteLine("================================================================================");
190 | ConsoleManager.WriteLine("VENDOR : " + vendor);
191 | ConsoleManager.WriteLine("VERSION : " + version);
192 | ConsoleManager.WriteLine("RENDERER : " + renderer);
193 | ConsoleManager.WriteLine("SHADER LANGUAGE : " + shader);
194 | }
195 |
196 | private static void Command_cpuinfo(string[] parameters)
197 | {
198 | ConsoleManager.WriteLine();
199 | ConsoleManager.WriteLine("CPU information...");
200 | ConsoleManager.WriteLine("================================================================================");
201 | ConsoleManager.WriteLine("Vendor String : " + CPUInfo.VendorString);
202 | ConsoleManager.WriteLine("Vendor Company : " + CPUInfo.VendorCompany);
203 | ConsoleManager.WriteLine("Processor Name : " + CPUInfo.CPUName.Trim());
204 | ConsoleManager.WriteLine("Processor Speed : " + CPUInfo.CPUSpeed + " Mhz");
205 |
206 | ConsoleManager.WriteLine();
207 | ConsoleManager.WriteLine("Processor Type : " + CPUInfo.CPUType);
208 | ConsoleManager.WriteLine("Processor Family : " + CPUInfo.CPUFamily);
209 | ConsoleManager.WriteLine("Processor Extended Family : " + CPUInfo.CPUExtendedFamily);
210 | ConsoleManager.WriteLine("Processor Model : " + CPUInfo.CPUModel);
211 | ConsoleManager.WriteLine("Processor Extended Model : " + CPUInfo.CPUExtendedModel);
212 | ConsoleManager.WriteLine("Processor Stepping ID : " + CPUInfo.CPUStepping);
213 |
214 | ConsoleManager.WriteLine();
215 | ConsoleManager.WriteLine("CPU features...");
216 | ConsoleManager.WriteLine("================================================================================");
217 |
218 | uint Counter = 0;
219 | string FlagBuffer = null;
220 |
221 | foreach (var CPUFlag in CPUInfo.FeatureFlags)
222 | {
223 | if (CPUFlag.Value)
224 | {
225 | Counter++;
226 |
227 | if ((Counter % 4) == 0)
228 | {
229 | FlagBuffer += CPUFlag.Key.PadRight(20, ' ');
230 |
231 | ConsoleManager.WriteLine(FlagBuffer);
232 |
233 | FlagBuffer = null;
234 | }
235 | else
236 | {
237 | FlagBuffer += CPUFlag.Key.PadRight(20, ' ');
238 | }
239 | }
240 | }
241 |
242 | ConsoleManager.WriteLine(FlagBuffer);
243 |
244 | if (CPUInfo.VendorCompany == CPUInfo.VendorCompanies.Intel)
245 | {
246 | ConsoleManager.WriteLine();
247 | ConsoleManager.WriteLine("CPU cache descriptors... (Intel)");
248 | ConsoleManager.WriteLine("================================================================================");
249 |
250 | for (byte counter = 0; counter < CPUInfo.IntelCacheDescriptors.Count; counter++)
251 | {
252 | ConsoleManager.WriteLine(CPUInfo.IntelCacheDescriptors[counter]);
253 | }
254 | }
255 | }
256 |
257 | private static void Command_version(string[] parameters)
258 | {
259 | ConsoleManager.WriteLine(ConsoleVarManager.GetValueToString("VersionLong"));
260 | }
261 |
262 | private static void Command_dumpconsole(string[] parameters)
263 | {
264 | if (parameters == null || parameters.Length != 1)
265 | {
266 | ConsoleManager.WriteLine("HELP: dumpconsole .txt");
267 | }
268 | else
269 | {
270 | ConsoleLogManager.DumpToFile(parameters[0]);
271 | }
272 | }
273 |
274 | private static void Command_stopmusic(string[] parameters)
275 | {
276 | waveOutDevice.Stop();
277 | }
278 |
279 | private static void Command_playmusic(string[] parameters)
280 | {
281 | if (parameters == null || parameters.Length != 1)
282 | {
283 | ConsoleManager.WriteLine("HELP: playmusic .mp3");
284 | }
285 | else
286 | {
287 | string MP3FileName = @"Music\" + parameters[0] + ".mp3";
288 |
289 | if (File.Exists(MP3FileName))
290 | {
291 | if (waveOutDevice.PlaybackState == PlaybackState.Playing || waveOutDevice.PlaybackState == PlaybackState.Paused)
292 | {
293 | waveOutDevice.Stop();
294 | }
295 |
296 | audioFileReader = new AudioFileReader(@"Music\" + parameters[0] + ".mp3");
297 | waveOutDevice.Init(audioFileReader);
298 |
299 | waveOutDevice.Play();
300 | }
301 | else
302 | {
303 | ConsoleManager.WriteLine("Error! The specified music track not found!");
304 | }
305 | }
306 | }
307 |
308 | private static void Command_background(string[] parameters)
309 | {
310 | if (parameters == null || parameters.Length != 1)
311 | {
312 | ConsoleManager.WriteLine("HELP: background ");
313 | }
314 | else
315 | {
316 | string ImageFileName = @"data\" + parameters[0];
317 |
318 | if (File.Exists(ImageFileName))
319 | {
320 | ConsoleVarManager.Set("ConsoleBackground", ImageFileName);
321 | ConsoleManager.Init();
322 | }
323 | else
324 | {
325 | ConsoleManager.WriteLine("Error! The specified background image not found!");
326 | }
327 | }
328 | }
329 |
330 | private static void Command_imagelist(string[] parameters)
331 | {
332 | uint MemoryUsage = 0;
333 |
334 | foreach (var Node in TextureManager.GetValues)
335 | {
336 | MemoryUsage += Node.DataSize;
337 |
338 | ConsoleManager.WriteLine(Node.FilePath.PadRight(32) + Node.DataSize.ToString().PadLeft(12) + " bytes.");
339 | }
340 |
341 | ConsoleManager.WriteLine("TOTAL MEMORY USAGE".PadRight(32) + MemoryUsage.ToString().PadLeft(12) + " bytes.");
342 | }
343 |
344 | private static void Command_demofreeglut(string[] parameters)
345 | {
346 | byte DemoFreeglut = ConsoleVarManager.GetValueToByte("DemoFreeglut");
347 |
348 | if (DemoFreeglut == 0)
349 | { // Start demo; Make sure that the other demos are stopped
350 | ConsoleVarManager.SetOrCreate("DemoFreeglut", "1", 0);
351 | ConsoleVarManager.SetOrCreate("DemoCubemapping", "0", 0);
352 | ConsoleVarManager.SetOrCreate("DemoGUI", "0", 0);
353 |
354 | ConsoleManager.WriteLine("Starting demo FREEGLUT...");
355 | }
356 | else
357 | { // Stop demo;
358 | ConsoleVarManager.SetOrCreate("DemoFreeglut", "0", 0);
359 | ConsoleVarManager.SetOrCreate("DemoCubemapping", "0", 0);
360 | ConsoleVarManager.SetOrCreate("DemoGUI", "0", 0);
361 |
362 | ConsoleManager.WriteLine("Stopping demo FREEGLUT...");
363 | }
364 | }
365 |
366 | private static void Command_democubemapping(string[] parameters)
367 | {
368 | byte DemoCubemapping = ConsoleVarManager.GetValueToByte("DemoCubemapping");
369 |
370 | if (DemoCubemapping == 0)
371 | { // Start demo; Make sure that the other demos are stopped
372 | ConsoleVarManager.SetOrCreate("DemoFreeglut", "0", 0);
373 | ConsoleVarManager.SetOrCreate("DemoCubemapping", "1", 0);
374 | ConsoleVarManager.SetOrCreate("DemoGUI", "0", 0);
375 | ConsoleManager.WriteLine("Starting demo CUBEMAPPING...");
376 | }
377 | else
378 | { // Stop demo;
379 | ConsoleVarManager.SetOrCreate("DemoFreeglut", "0", 0);
380 | ConsoleVarManager.SetOrCreate("DemoCubemapping", "0", 0);
381 | ConsoleVarManager.SetOrCreate("DemoGUI", "0", 0);
382 |
383 | ConsoleManager.WriteLine("Stopping demo CUBEMAPPING...");
384 | }
385 | }
386 |
387 | private static void Command_demogui(string[] parameters)
388 | {
389 | byte DemoGUI = ConsoleVarManager.GetValueToByte("DemoGUI");
390 |
391 | if (DemoGUI == 0)
392 | { // Start demo; Make sure that the other demos are stopped
393 | ConsoleVarManager.SetOrCreate("DemoFreeglut", "0", 0);
394 | ConsoleVarManager.SetOrCreate("DemoCubemapping", "0", 0);
395 | ConsoleVarManager.SetOrCreate("DemoGUI", "1", 0);
396 |
397 | ConsoleManager.WriteLine("Starting demo GUI...");
398 | }
399 | else
400 | { // Stop demo;
401 | ConsoleVarManager.SetOrCreate("DemoCubemapping", "0", 0);
402 | ConsoleVarManager.SetOrCreate("DemoFreeglut", "0", 0);
403 | ConsoleVarManager.SetOrCreate("DemoGUI", "0", 0);
404 |
405 | ConsoleManager.WriteLine("Stopping demo GUI...");
406 | }
407 | }
408 | }
409 | }
410 |
--------------------------------------------------------------------------------
/Source/Demos/Q2ConsoleVarManager.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : q2consolevarmanager.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : This file is part of Quake 2 Console Demo. The Q2ConsoleVarManager
6 | // (Quake 2 Console Variable Manager) actually holds (creates, reads
7 | // and changes) the internal variables used by Quake 2 Console.
8 | // WEB : https://github.com/carmack78/opengldotnet
9 | // AUTHOR : TAYLAN INAN
10 | // E-MAIL : taylaninan@yahoo.com
11 | // DATE : 2014-2018
12 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
13 | // ----------------------------------------------------------------------------
14 |
15 | using System;
16 | using System.Collections.Generic;
17 | using Common;
18 |
19 | namespace Quake2DotNet
20 | {
21 | ///////////////////////////////////////////////////////////////////////////
22 | // CONSOLE VARIABLE MANAGER
23 | ///////////////////////////////////////////////////////////////////////////
24 | public class ConsoleVarNode
25 | {
26 | public string Name;
27 | public string Value;
28 | public uint Flags;
29 | }
30 |
31 | public static class ConsoleVarManager
32 | {
33 | private static Dictionary ConsoleVars = new Dictionary();
34 |
35 | public static void Init()
36 | {
37 | Create("Q2ConsoleInit", "true", 0); // When TRUE, Quake 2 Console MUST be initiated.
38 | Create("VersionLong", "OpenGLDotNet v1.1.3 Demos", 0);
39 | Create("VersionShort", "v1.1.3", 0);
40 | Create("ScreenWidth", "1024", 0);
41 | Create("ScreenHeight", "768", 0);
42 | Create("ConsoleBackground", "conback2.jpg", 0);
43 | Create("ConsoleCharacters", "conchars.png", 0);
44 | Create("DemoFreeglut", "0", 0);
45 | Create("DemoCubemapping", "0", 0);
46 | Create("DemoGUI", "0", 0);
47 |
48 | Random RandomTrack = new Random();
49 | int TrackNumber = RandomTrack.Next(1, 10);
50 | string TrackString = "track" + TrackNumber.ToString().PadLeft(2, '0') + ".mp3";
51 | Create("MusicTrack", TrackString, 0);
52 | }
53 |
54 | public static ConsoleVarNode FindVar(string Name)
55 | {
56 | if (ConsoleVars.ContainsKey(Name))
57 | {
58 | return ConsoleVars[Name];
59 | }
60 | else
61 | {
62 | return null;
63 | }
64 | }
65 |
66 | public static string GetValueToString(string Name)
67 | {
68 | ConsoleVarNode Node = FindVar(Name);
69 |
70 | if (Node != null)
71 | {
72 | return Node.Value;
73 | }
74 | else
75 | {
76 | return "";
77 | }
78 | }
79 |
80 | public static uint GetValueToUInt(string Name)
81 | {
82 | ConsoleVarNode Node = FindVar(Name);
83 |
84 | if (Node != null)
85 | {
86 | return ConvertX.ToUInt(Node.Value, 0, "", "trim", 0);
87 | }
88 | else
89 | {
90 | return 0;
91 | }
92 | }
93 |
94 | public static ushort GetValueToUShort(string Name)
95 | {
96 | ConsoleVarNode Node = FindVar(Name);
97 |
98 | if (Node != null)
99 | {
100 | return ConvertX.ToUShort(Node.Value, 0, "", "trim", 0);
101 | }
102 | else
103 | {
104 | return 0;
105 | }
106 | }
107 |
108 | public static byte GetValueToByte (string Name)
109 | {
110 | ConsoleVarNode Node = FindVar(Name);
111 |
112 | if (Node != null)
113 | {
114 | return ConvertX.ToByte(Node.Value, 0, "", "trim", 0);
115 | }
116 | else
117 | {
118 | return 0;
119 | }
120 | }
121 |
122 | public static ConsoleVarNode Create(string var_name, string var_value, uint flags)
123 | {
124 | ConsoleVarNode Result = FindVar(var_name);
125 |
126 | // If the variable not found, then add a new one.
127 | if (Result == null)
128 | {
129 | ConsoleVarNode Node = new ConsoleVarNode();
130 |
131 | Node.Name = var_name;
132 | Node.Value = var_value;
133 | Node.Flags = flags;
134 |
135 | ConsoleVars.Add(var_name, Node);
136 |
137 | Result = Node;
138 | }
139 |
140 | return Result;
141 | }
142 |
143 | // With flags
144 | public static ConsoleVarNode Set(string var_name, string var_value, uint flags)
145 | {
146 | ConsoleVarNode Result = FindVar(var_name);
147 |
148 | if (Result != null)
149 | {
150 | Result.Name = var_name;
151 | Result.Value = var_value;
152 | Result.Flags = flags;
153 | }
154 |
155 | return Result;
156 | }
157 |
158 | // Without flags
159 | public static ConsoleVarNode Set(string var_name, string var_value)
160 | {
161 | ConsoleVarNode Result = FindVar(var_name);
162 |
163 | if (Result != null)
164 | {
165 | Result.Name = var_name;
166 | Result.Value = var_value;
167 | }
168 |
169 | return Result;
170 | }
171 |
172 | public static ConsoleVarNode SetOrCreate(string var_name, string var_value, uint flags)
173 | {
174 | ConsoleVarNode Result = FindVar(var_name);
175 |
176 | if (Result == null)
177 | {
178 | Result = Create(var_name, var_value, flags);
179 | }
180 | else
181 | {
182 | Result = Set(var_name, var_value, flags);
183 | }
184 |
185 | return Result;
186 | }
187 | }
188 | }
189 |
--------------------------------------------------------------------------------
/Source/Demos/Q2TextureManager.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : q2texturemanager.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : This file is part of Quake 2 Console Demo. The Q2TextureManager
6 | // provides FilePath normalization, Texture reading from disk, holding
7 | // the textures in the computer memory and uploading them to the GPU
8 | // services.
9 | // WEB : https://github.com/carmack78/opengldotnet
10 | // AUTHOR : TAYLAN INAN
11 | // E-MAIL : taylaninan@yahoo.com
12 | // DATE : 2014-2018
13 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
14 | // ----------------------------------------------------------------------------
15 |
16 | using System;
17 | using System.Collections.Generic;
18 | using System.IO;
19 | using OpenGLDotNet;
20 |
21 | namespace Quake2DotNet
22 | {
23 | public class TextureNode
24 | {
25 | public string FilePath = null;
26 | public uint GLTextureNumber = 0;
27 | public uint GLImageFormat = 0;
28 | public uint GLImageType = 0;
29 | public uint Width = 0;
30 | public uint Height = 0;
31 | public uint Depth = 0; // Quake2 does not seem to use 3D textures, but anyway here it goes...
32 | public uint DataSize = 0;
33 | }
34 |
35 | public static class TextureManager
36 | {
37 | // Texture Manager (TM), PreProcess (PP) Bit Flags
38 | public const byte TM_PP_NONE = 0x00;
39 | public const byte TM_PP_FLIP_IMAGE = 0x01;
40 | public const byte TM_PP_MIRROR_IMAGE = 0x02;
41 |
42 | private static SortedList Textures = new SortedList(); //
43 |
44 | private static string FilePathStandardization(string FilePath)
45 | {
46 | // Build a standard "data\" beginning FilePath
47 | string FilePathShort = FilePath.ToLower().Replace("/", @"\");
48 |
49 | if (!FilePathShort.StartsWith(@"\data\") && !FilePathShort.StartsWith(@"data\") && !FilePathShort.StartsWith("data"))
50 | {
51 | FilePathShort = @"data\" + FilePathShort;
52 | FilePathShort = FilePathShort.Replace(@"\\", @"\");
53 | }
54 |
55 | return FilePathShort;
56 | }
57 |
58 | public static TextureNode FindTexture(string FilePath)
59 | {
60 | FilePath = FilePathStandardization(FilePath);
61 |
62 | if (Textures.ContainsKey(FilePath))
63 | {
64 | return Textures[FilePath];
65 | }
66 | else
67 | {
68 | return null;
69 | }
70 | }
71 |
72 | public static uint FindTextureNumber(string FilePath)
73 | {
74 | FilePath = FilePathStandardization(FilePath);
75 |
76 | if (Textures.ContainsKey(FilePath))
77 | {
78 | return Textures[FilePath].GLTextureNumber;
79 | }
80 | else
81 | {
82 | return 0;
83 | }
84 | }
85 |
86 | public static TextureNode LoadTexture(string FilePath, uint GLTarget, byte ImagePreProcess)
87 | {
88 | string FilePathShort = FilePathStandardization(FilePath);
89 |
90 | // Is it already loaded?
91 | if (FindTexture(FilePathShort) != null)
92 | {
93 | return FindTexture(FilePathShort);
94 | }
95 | // Texture not found, load it into the memory
96 | else
97 | {
98 | // Add the current working directory of OpenGLDotNet
99 | string currentDirName = System.IO.Directory.GetCurrentDirectory();
100 | string FilePathLong = currentDirName + @"\" + FilePathShort;
101 | FilePathLong = FilePathLong.Replace(@"\\", @"\");
102 |
103 | // Generate a new image number from DevIL
104 | uint ILTextureNumber = IL.GenImage();
105 | IL.BindImage(ILTextureNumber);
106 |
107 | // Load it into the memory with DevIL
108 | if (IL.LoadImage(FilePathLong))
109 | {
110 | // Preprocess Check
111 | if ((ImagePreProcess & TM_PP_FLIP_IMAGE) > 0)
112 | {
113 | ILU.FlipImage();
114 | }
115 | if ((ImagePreProcess & TM_PP_MIRROR_IMAGE) > 0)
116 | {
117 | ILU.Mirror();
118 | }
119 |
120 | // Create a new TextureNode
121 | TextureNode Node = new TextureNode();
122 |
123 | Node.FilePath = FilePathShort;
124 | Node.Width = (uint)IL.GetInteger(IL.IL_IMAGE_WIDTH);
125 | Node.Height = (uint)IL.GetInteger(IL.IL_IMAGE_HEIGHT);
126 | Node.Depth = (uint)IL.GetInteger(IL.IL_IMAGE_DEPTH);
127 | Node.GLImageFormat = (uint)IL.GetInteger(IL.IL_IMAGE_FORMAT);
128 | Node.GLImageType = (uint)IL.GetInteger(IL.IL_IMAGE_TYPE);
129 | Node.DataSize = (uint)IL.GetInteger(IL.IL_IMAGE_SIZE_OF_DATA);
130 |
131 | // Generate a new texture number from OpenGL
132 | uint[] GLTextureNumber = new uint[1];
133 | GL.GenTextures(1, GLTextureNumber);
134 | // Assign the new number to node
135 | Node.GLTextureNumber = GLTextureNumber[0];
136 |
137 | GL.BindTexture(GLTarget, Node.GLTextureNumber);
138 | GL.TexImage2D(GLTarget, 0, (int)Node.GLImageFormat, (int)Node.Width, (int)Node.Height, 0, Node.GLImageFormat, Node.GLImageType, IL.GetData());
139 |
140 | GL.TexParameteri(GLTarget, GL.GL_TEXTURE_WRAP_S, (int)GL.GL_CLAMP_TO_EDGE);
141 | GL.TexParameteri(GLTarget, GL.GL_TEXTURE_WRAP_T, (int)GL.GL_CLAMP_TO_EDGE);
142 | GL.TexParameteri(GLTarget, GL.GL_TEXTURE_WRAP_R, (int)GL.GL_CLAMP_TO_EDGE);
143 | GL.TexParameteri(GLTarget, GL.GL_TEXTURE_MAG_FILTER, (int)GL.GL_LINEAR);
144 | GL.TexParameteri(GLTarget, GL.GL_TEXTURE_MIN_FILTER, (int)GL.GL_LINEAR);
145 |
146 | // We are done uploading the image, free up memory from DevIL
147 | IL.DeleteImage(ILTextureNumber);
148 |
149 | Textures.Add(FilePathShort, Node);
150 |
151 | return Node;
152 | }
153 | // Texture couldn't be loaded, return null
154 | else
155 | {
156 | return null;
157 | }
158 | }
159 | }
160 |
161 | public static TextureNode LoadCubemapTexture(string FilePath, uint GLTarget, byte ImagePreProcess)
162 | {
163 | string FilePathShort = FilePathStandardization(FilePath);
164 |
165 | // Is it already loaded?
166 | if (FindTexture(FilePathShort) != null)
167 | {
168 | return FindTexture(FilePathShort);
169 | }
170 | // Texture not found, load it into the memory
171 | else
172 | {
173 | // Add the current working directory of OpenGLDotNet
174 | string currentDirName = System.IO.Directory.GetCurrentDirectory();
175 | string FilePathLong = currentDirName + @"\" + FilePathShort;
176 | FilePathLong = FilePathLong.Replace(@"\\", @"\");
177 |
178 | // Generate a new image number from DevIL
179 | uint ILTextureNumber = IL.GenImage();
180 | IL.BindImage(ILTextureNumber);
181 |
182 | // Load it into the memory with DevIL
183 | if (IL.LoadImage(FilePathLong))
184 | {
185 | // Preprocess Check
186 | if ((ImagePreProcess & TM_PP_FLIP_IMAGE) > 0)
187 | {
188 | ILU.FlipImage();
189 | }
190 | if ((ImagePreProcess & TM_PP_MIRROR_IMAGE) > 0)
191 | {
192 | ILU.Mirror();
193 | }
194 |
195 | // Create a new TextureNode
196 | TextureNode Node = new TextureNode();
197 |
198 | Node.FilePath = FilePathShort;
199 | Node.Width = (uint)IL.GetInteger(IL.IL_IMAGE_WIDTH);
200 | Node.Height = (uint)IL.GetInteger(IL.IL_IMAGE_HEIGHT);
201 | Node.Depth = (uint)IL.GetInteger(IL.IL_IMAGE_DEPTH);
202 | Node.GLImageFormat = (uint)IL.GetInteger(IL.IL_IMAGE_FORMAT);
203 | Node.GLImageType = (uint)IL.GetInteger(IL.IL_IMAGE_TYPE);
204 | Node.DataSize = (uint)IL.GetInteger(IL.IL_IMAGE_SIZE_OF_DATA);
205 |
206 | // Generate a new texture number from OpenGL
207 | uint[] GLTextureNumber = new uint[1];
208 | GL.GenTextures(1, GLTextureNumber);
209 | // Assign the new number to node
210 | Node.GLTextureNumber = GLTextureNumber[0];
211 |
212 | GL.BindTexture(GLTarget, Node.GLTextureNumber);
213 | GL.TexImage2D(GLTarget, 0, (int)Node.GLImageFormat, (int)Node.Width, (int)Node.Height, 0, Node.GLImageFormat, Node.GLImageType, IL.GetData());
214 |
215 | GL.TexParameteri(GL.GL_TEXTURE_CUBE_MAP, GL.GL_TEXTURE_WRAP_S, (int)GL.GL_CLAMP_TO_EDGE);
216 | GL.TexParameteri(GL.GL_TEXTURE_CUBE_MAP, GL.GL_TEXTURE_WRAP_T, (int)GL.GL_CLAMP_TO_EDGE);
217 | GL.TexParameteri(GL.GL_TEXTURE_CUBE_MAP, GL.GL_TEXTURE_WRAP_R, (int)GL.GL_CLAMP_TO_EDGE);
218 | GL.TexParameteri(GL.GL_TEXTURE_CUBE_MAP, GL.GL_TEXTURE_MAG_FILTER, (int)GL.GL_LINEAR);
219 | GL.TexParameteri(GL.GL_TEXTURE_CUBE_MAP, GL.GL_TEXTURE_MIN_FILTER, (int)GL.GL_LINEAR);
220 |
221 | // We are done uploading the image, free up memory from DevIL
222 | IL.DeleteImage(ILTextureNumber);
223 |
224 | Textures.Add(FilePathShort, Node);
225 |
226 | return Node;
227 | }
228 | // Texture couldn't be loaded, return null
229 | else
230 | {
231 | return null;
232 | }
233 | }
234 | }
235 |
236 | public static void DeleteTexture(string FilePath)
237 | {
238 | string FilePathShort = FilePathStandardization(FilePath);
239 |
240 | // Is it already loaded?
241 | TextureNode Node = FindTexture(FilePathShort);
242 |
243 | if (Node != null)
244 | {
245 | uint[] GLTextureNumber = new uint[1];
246 | GLTextureNumber[0] = Node.GLTextureNumber;
247 |
248 | GL.DeleteTextures(1, GLTextureNumber);
249 |
250 | Textures.Remove(FilePathShort);
251 | }
252 | }
253 |
254 | public static void DeleteTexture(TextureNode Node)
255 | {
256 | if (Node != null)
257 | {
258 | DeleteTexture(Node.FilePath);
259 | }
260 | }
261 |
262 | public static IList GetValues
263 | {
264 | get
265 | {
266 | return Textures.Values;
267 | }
268 | }
269 | }
270 | }
271 |
--------------------------------------------------------------------------------
/Source/Imaging/ILU.Constants.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : ilu.constants.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : Image Library Utility (ILU). This "imported header" (from C/C++)
6 | // defines required constants for use with ILU.
7 | // WEB : https://github.com/carmack78/opengldotnet
8 | // AUTHOR : TAYLAN INAN
9 | // E-MAIL : taylaninan@yahoo.com
10 | // DATE : 2014-2018
11 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
12 | // ----------------------------------------------------------------------------
13 |
14 | using System;
15 |
16 | namespace OpenGLDotNet
17 | {
18 | public static partial class ILU
19 | {
20 | ///////////////////////////////////////////////////////////////////////
21 | // DevIL/ILU v1.7.8 CONSTANTS
22 | ///////////////////////////////////////////////////////////////////////
23 | public const byte ILU_VERSION_1_7_8 = 1;
24 | public const byte ILU_VERSION = 178;
25 |
26 | public const uint ILU_VERSION_NUM = IL.IL_VERSION_NUM;
27 | public const uint ILU_VENDOR = IL.IL_VENDOR;
28 |
29 | // Scaling Filters
30 | public const uint ILU_FILTER = 0x2600;
31 | public const uint ILU_NEAREST = 0x2601;
32 | public const uint ILU_LINEAR = 0x2602;
33 | public const uint ILU_BILINEAR = 0x2603;
34 | public const uint ILU_SCALE_BOX = 0x2604;
35 | public const uint ILU_SCALE_TRIANGLE = 0x2605;
36 | public const uint ILU_SCALE_BELL = 0x2606;
37 | public const uint ILU_SCALE_BSPLINE = 0x2607;
38 | public const uint ILU_SCALE_LANCZOS3 = 0x2608;
39 | public const uint ILU_SCALE_MITCHELL = 0x2609;
40 |
41 | // Error types
42 | public const uint ILU_INVALID_ENUM = 0x0501;
43 | public const uint ILU_OUT_OF_MEMORY = 0x0502;
44 | public const uint ILU_INTERNAL_ERROR = 0x0504;
45 | public const uint ILU_INVALID_VALUE = 0x0505;
46 | public const uint ILU_ILLEGAL_OPERATION = 0x0506;
47 | public const uint ILU_INVALID_PARAM = 0x0509;
48 |
49 | // Values
50 | public const uint ILU_PLACEMENT = 0x0700;
51 | public const uint ILU_LOWER_LEFT = 0x0701;
52 | public const uint ILU_LOWER_RIGHT = 0x0702;
53 | public const uint ILU_UPPER_LEFT = 0x0703;
54 | public const uint ILU_UPPER_RIGHT = 0x0704;
55 | public const uint ILU_CENTER = 0x0705;
56 | public const uint ILU_CONVOLUTION_MATRIX = 0x0710;
57 |
58 | // Languages
59 | public const uint ILU_ENGLISH = 0x0800;
60 | public const uint ILU_ARABIC = 0x0801;
61 | public const uint ILU_DUTCH = 0x0802;
62 | public const uint ILU_JAPANESE = 0x0803;
63 | public const uint ILU_SPANISH = 0x0804;
64 | public const uint ILU_GERMAN = 0x0805;
65 | public const uint ILU_FRENCH = 0x0806;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Source/Imaging/ILU.Functions.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : ilu.functions.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : Image Library Utility (ILU). This "imported header" (from C/C++)
6 | // defines low level delegates and functions as close to C/C++.
7 | // WEB : https://github.com/carmack78/opengldotnet
8 | // AUTHOR : TAYLAN INAN
9 | // E-MAIL : taylaninan@yahoo.com
10 | // DATE : 2014-2018
11 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
12 | // ----------------------------------------------------------------------------
13 |
14 | using System;
15 | using System.Runtime.InteropServices;
16 |
17 | using ILenum = System.UInt32;
18 | using ILboolean = System.Boolean;
19 | using ILbitfield = System.UInt32;
20 | using ILbyte = System.SByte;
21 | using ILshort = System.Int16;
22 | using ILint = System.Int32;
23 | using ILsizei = System.UInt32;
24 | using ILubyte = System.Byte;
25 | using ILushort = System.UInt16;
26 | using ILuint = System.UInt32;
27 | using ILfloat = System.Single;
28 | using ILclampf = System.Single;
29 | using ILdouble = System.Double;
30 | using ILclampd = System.Double;
31 | using ILint64 = System.Int64;
32 | using ILuint64 = System.UInt64;
33 | using ILchar = System.Byte;
34 | using ILstring = System.String;
35 | using ILconst_string = System.String;
36 | using ILhandle = System.IntPtr;
37 |
38 | namespace OpenGLDotNet
39 | {
40 | public static partial class ILU
41 | {
42 | ///////////////////////////////////////////////////////////////////////
43 | // DevIL/ILU v1.7.8 FUNCTIONS
44 | ///////////////////////////////////////////////////////////////////////
45 | // ILAPI ILboolean ILAPIENTRY iluAlienify(void);
46 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
47 | [System.Security.SuppressUnmanagedCodeSecurity()]
48 | private static extern ILboolean iluAlienify();
49 |
50 | // ILAPI ILboolean ILAPIENTRY iluBlurAvg(ILuint Iter);
51 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
52 | [System.Security.SuppressUnmanagedCodeSecurity()]
53 | private static extern ILboolean iluBlurAvg(ILuint Iter);
54 |
55 | // ILAPI ILboolean ILAPIENTRY iluBlurGaussian(ILuint Iter);
56 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
57 | [System.Security.SuppressUnmanagedCodeSecurity()]
58 | private static extern ILboolean iluBlurGaussian(ILuint Iter);
59 |
60 | // ILAPI ILboolean ILAPIENTRY iluBuildMipmaps(void);
61 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
62 | [System.Security.SuppressUnmanagedCodeSecurity()]
63 | private static extern ILboolean iluBuildMipmaps();
64 |
65 | // ILAPI ILuint ILAPIENTRY iluColoursUsed(void);
66 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
67 | [System.Security.SuppressUnmanagedCodeSecurity()]
68 | private static extern ILuint iluColoursUsed();
69 |
70 | // ILAPI ILboolean ILAPIENTRY iluCompareImage(ILuint Comp);
71 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
72 | [System.Security.SuppressUnmanagedCodeSecurity()]
73 | private static extern ILboolean iluCompareImage(ILuint Comp);
74 |
75 | // ILAPI ILboolean ILAPIENTRY iluContrast(ILfloat Contrast);
76 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
77 | [System.Security.SuppressUnmanagedCodeSecurity()]
78 | private static extern ILboolean iluContrast(ILfloat Contrast);
79 |
80 | // ILAPI ILboolean ILAPIENTRY iluCrop(ILuint XOff, ILuint YOff, ILuint ZOff, ILuint Width, ILuint Height, ILuint Depth);
81 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
82 | [System.Security.SuppressUnmanagedCodeSecurity()]
83 | private static extern ILboolean iluCrop(ILuint XOff, ILuint YOff, ILuint ZOff, ILuint Width, ILuint Height, ILuint Depth);
84 |
85 | // ILAPI void ILAPIENTRY iluDeleteImage(ILuint Id); // Deprecated
86 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
87 | [System.Security.SuppressUnmanagedCodeSecurity()]
88 | private static extern void iluDeleteImage(ILuint Id);
89 |
90 | // ILAPI ILboolean ILAPIENTRY iluEdgeDetectE(void);
91 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
92 | [System.Security.SuppressUnmanagedCodeSecurity()]
93 | private static extern ILboolean iluEdgeDetectE();
94 |
95 | // ILAPI ILboolean ILAPIENTRY iluEdgeDetectP(void);
96 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
97 | [System.Security.SuppressUnmanagedCodeSecurity()]
98 | private static extern ILboolean iluEdgeDetectP();
99 |
100 | // ILAPI ILboolean ILAPIENTRY iluEdgeDetectS(void);
101 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
102 | [System.Security.SuppressUnmanagedCodeSecurity()]
103 | private static extern ILboolean iluEdgeDetectS();
104 |
105 | // ILAPI ILboolean ILAPIENTRY iluEmboss(void);
106 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
107 | [System.Security.SuppressUnmanagedCodeSecurity()]
108 | private static extern ILboolean iluEmboss();
109 |
110 | // ILAPI ILboolean ILAPIENTRY iluEnlargeCanvas(ILuint Width, ILuint Height, ILuint Depth);
111 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
112 | [System.Security.SuppressUnmanagedCodeSecurity()]
113 | private static extern ILboolean iluEnlargeCanvas(ILuint Width, ILuint Height, ILuint Depth);
114 |
115 | // ILAPI ILboolean ILAPIENTRY iluEnlargeImage(ILfloat XDim, ILfloat YDim, ILfloat ZDim);
116 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
117 | [System.Security.SuppressUnmanagedCodeSecurity()]
118 | private static extern ILboolean iluEnlargeImage(ILfloat XDim, ILfloat YDim, ILfloat ZDim);
119 |
120 | // ILAPI ILboolean ILAPIENTRY iluEqualize(void);
121 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
122 | [System.Security.SuppressUnmanagedCodeSecurity()]
123 | private static extern ILboolean iluEqualize();
124 |
125 | // ILAPI ILconst_string ILAPIENTRY iluErrorString(ILenum Error);
126 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
127 | [System.Security.SuppressUnmanagedCodeSecurity()]
128 | private unsafe static extern ILchar* iluErrorString(ILenum Error);
129 |
130 | // ILAPI ILboolean ILAPIENTRY iluConvolution(ILint *matrix, ILint scale, ILint bias);
131 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
132 | [System.Security.SuppressUnmanagedCodeSecurity()]
133 | private unsafe static extern ILboolean iluConvolution(ILint* matrix, ILint scale, ILint bias);
134 |
135 | // ILAPI ILboolean ILAPIENTRY iluFlipImage(void);
136 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
137 | [System.Security.SuppressUnmanagedCodeSecurity()]
138 | private static extern ILboolean iluFlipImage();
139 |
140 | // ILAPI ILboolean ILAPIENTRY iluGammaCorrect(ILfloat Gamma);
141 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
142 | [System.Security.SuppressUnmanagedCodeSecurity()]
143 | private static extern ILboolean iluGammaCorrect(ILfloat Gamma);
144 |
145 | // ILAPI ILuint ILAPIENTRY iluGenImage(void); // Deprecated
146 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
147 | [System.Security.SuppressUnmanagedCodeSecurity()]
148 | private static extern ILuint iluGenImage();
149 |
150 | // ILAPI void ILAPIENTRY iluGetImageInfo(ILinfo *Info);
151 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
152 | [System.Security.SuppressUnmanagedCodeSecurity()]
153 | private static extern void iluGetImageInfo([MarshalAs(UnmanagedType.LPStruct)] ILInfo Info);
154 |
155 | // ILAPI ILint ILAPIENTRY iluGetInteger(ILenum Mode);
156 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
157 | [System.Security.SuppressUnmanagedCodeSecurity()]
158 | private static extern ILint iluGetInteger(ILenum Mode);
159 |
160 | // ILAPI void ILAPIENTRY iluGetIntegerv(ILenum Mode, ILint *Param);
161 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
162 | [System.Security.SuppressUnmanagedCodeSecurity()]
163 | private unsafe static extern void iluGetIntegerv(ILenum Mode, ILint* Param);
164 |
165 | // ILAPI ILstring ILAPIENTRY iluGetString(ILenum StringName);
166 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
167 | [System.Security.SuppressUnmanagedCodeSecurity()]
168 | private unsafe static extern ILchar* iluGetString(ILenum StringName);
169 |
170 | // ILAPI void ILAPIENTRY iluImageParameter(ILenum PName, ILenum Param);
171 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
172 | [System.Security.SuppressUnmanagedCodeSecurity()]
173 | private static extern void iluImageParameter(ILenum PName, ILenum Param);
174 |
175 | // ILAPI void ILAPIENTRY iluInit(void);
176 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
177 | [System.Security.SuppressUnmanagedCodeSecurity()]
178 | private static extern void iluInit();
179 |
180 | // ILAPI ILboolean ILAPIENTRY iluInvertAlpha(void);
181 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
182 | [System.Security.SuppressUnmanagedCodeSecurity()]
183 | private static extern ILboolean iluInvertAlpha();
184 |
185 | // ILAPI ILuint ILAPIENTRY iluLoadImage(ILconst_string FileName);
186 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
187 | [System.Security.SuppressUnmanagedCodeSecurity()]
188 | private static extern ILuint iluLoadImage(ILconst_string FileName);
189 |
190 | // ILAPI ILboolean ILAPIENTRY iluMirror(void);
191 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
192 | [System.Security.SuppressUnmanagedCodeSecurity()]
193 | private static extern ILboolean iluMirror();
194 |
195 | // ILAPI ILboolean ILAPIENTRY iluNegative(void);
196 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
197 | [System.Security.SuppressUnmanagedCodeSecurity()]
198 | private static extern ILboolean iluNegative();
199 |
200 | // ILAPI ILboolean ILAPIENTRY iluNoisify(ILclampf Tolerance);
201 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
202 | [System.Security.SuppressUnmanagedCodeSecurity()]
203 | private static extern ILboolean iluNoisify(ILclampf Tolerance);
204 |
205 | // ILAPI ILboolean ILAPIENTRY iluPixelize(ILuint PixSize);
206 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
207 | [System.Security.SuppressUnmanagedCodeSecurity()]
208 | private static extern ILboolean iluPixelize(ILuint PixSize);
209 |
210 | // ILAPI void ILAPIENTRY iluRegionfv(ILpointf *Points, ILuint n);
211 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
212 | [System.Security.SuppressUnmanagedCodeSecurity()]
213 | private unsafe static extern void iluRegionfv(ILPointf* Points, ILuint n);
214 |
215 | // ILAPI void ILAPIENTRY iluRegioniv(ILpointi *Points, ILuint n);
216 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
217 | [System.Security.SuppressUnmanagedCodeSecurity()]
218 | private unsafe static extern void iluRegioniv(ILPointi* Points, ILuint n);
219 |
220 | // ILAPI ILboolean ILAPIENTRY iluReplaceColour(ILubyte Red, ILubyte Green, ILubyte Blue, ILfloat Tolerance);
221 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
222 | [System.Security.SuppressUnmanagedCodeSecurity()]
223 | private static extern ILboolean iluReplaceColour(ILubyte Red, ILubyte Green, ILubyte Blue, ILfloat Tolerance);
224 |
225 | // ILAPI ILboolean ILAPIENTRY iluRotate(ILfloat Angle);
226 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
227 | [System.Security.SuppressUnmanagedCodeSecurity()]
228 | private static extern ILboolean iluRotate(ILfloat Angle);
229 |
230 | // ILAPI ILboolean ILAPIENTRY iluRotate3D(ILfloat x, ILfloat y, ILfloat z, ILfloat Angle);
231 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
232 | [System.Security.SuppressUnmanagedCodeSecurity()]
233 | private static extern ILboolean iluRotate3D(ILfloat x, ILfloat y, ILfloat z, ILfloat Angle);
234 |
235 | // ILAPI ILboolean ILAPIENTRY iluSaturate1f(ILfloat Saturation);
236 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
237 | [System.Security.SuppressUnmanagedCodeSecurity()]
238 | private static extern ILboolean iluSaturate1f(ILfloat Saturation);
239 |
240 | // ILAPI ILboolean ILAPIENTRY iluSaturate4f(ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation);
241 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
242 | [System.Security.SuppressUnmanagedCodeSecurity()]
243 | private static extern ILboolean iluSaturate4f(ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation);
244 |
245 | // ILAPI ILboolean ILAPIENTRY iluScale(ILuint Width, ILuint Height, ILuint Depth);
246 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
247 | [System.Security.SuppressUnmanagedCodeSecurity()]
248 | private static extern ILboolean iluScale(ILuint Width, ILuint Height, ILuint Depth);
249 |
250 | // ILAPI ILboolean ILAPIENTRY iluScaleAlpha(ILfloat scale);
251 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
252 | [System.Security.SuppressUnmanagedCodeSecurity()]
253 | private static extern ILboolean iluScaleAlpha(ILfloat Scale);
254 |
255 | // ILAPI ILboolean ILAPIENTRY iluScaleColours(ILfloat r, ILfloat g, ILfloat b);
256 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
257 | [System.Security.SuppressUnmanagedCodeSecurity()]
258 | private static extern ILboolean iluScaleColours(ILfloat r, ILfloat g, ILfloat b);
259 |
260 | // ILAPI ILboolean ILAPIENTRY iluSetLanguage(ILenum Language);
261 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
262 | [System.Security.SuppressUnmanagedCodeSecurity()]
263 | private static extern ILboolean iluSetLanguage(ILenum Language);
264 |
265 | // ILAPI ILboolean ILAPIENTRY iluSharpen(ILfloat Factor, ILuint Iter);
266 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
267 | [System.Security.SuppressUnmanagedCodeSecurity()]
268 | private static extern ILboolean iluSharpen(ILfloat Factor, ILuint Iter);
269 |
270 | // ILAPI ILboolean ILAPIENTRY iluSwapColours(void);
271 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
272 | [System.Security.SuppressUnmanagedCodeSecurity()]
273 | private static extern ILboolean iluSwapColours();
274 |
275 | // ILAPI ILboolean ILAPIENTRY iluWave(ILfloat Angle);
276 | [DllImport("ILU.dll", CallingConvention = CallingConvention.StdCall)]
277 | [System.Security.SuppressUnmanagedCodeSecurity()]
278 | private static extern ILboolean iluWave(ILfloat Angle);
279 | }
280 | }
281 |
--------------------------------------------------------------------------------
/Source/Imaging/ILU.Types.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : ilu.types.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : Image Library Utility (ILU). This "imported header" (from C/C++)
6 | // defines required types for use with ILU.
7 | // WEB : https://github.com/carmack78/opengldotnet
8 | // AUTHOR : TAYLAN INAN
9 | // E-MAIL : taylaninan@yahoo.com
10 | // DATE : 2014-2018
11 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
12 | // ----------------------------------------------------------------------------
13 |
14 | using System;
15 | using System.Runtime.InteropServices;
16 |
17 | using ILenum = System.UInt32;
18 | using ILboolean = System.Boolean;
19 | using ILbitfield = System.UInt32;
20 | using ILbyte = System.SByte;
21 | using ILshort = System.Int16;
22 | using ILint = System.Int32;
23 | using ILsizei = System.UInt32;
24 | using ILubyte = System.Byte;
25 | using ILushort = System.UInt16;
26 | using ILuint = System.UInt32;
27 | using ILfloat = System.Single;
28 | using ILclampf = System.Single;
29 | using ILdouble = System.Double;
30 | using ILclampd = System.Double;
31 | using ILint64 = System.Int64;
32 | using ILuint64 = System.UInt64;
33 | using ILchar = System.Byte;
34 | using ILstring = System.String;
35 | using ILconst_string = System.String;
36 | using ILhandle = System.IntPtr;
37 |
38 | namespace OpenGLDotNet
39 | {
40 | public static partial class ILU
41 | {
42 | ///////////////////////////////////////////////////////////////////////
43 | // DevIL/ILU v1.7.8 TYPES
44 | ///////////////////////////////////////////////////////////////////////
45 | [StructLayout(LayoutKind.Sequential)]
46 | public class ILInfo
47 | {
48 | ILuint Id; // the image's id
49 | ILhandle Data; // the image's data
50 | ILuint Width; // the image's width
51 | ILuint Height; // the image's height
52 | ILuint Depth; // the image's depth
53 | ILubyte Bpp; // bytes per pixel (not bits) of the image
54 | ILuint SizeOfData; // the total size of the data (in bytes)
55 | ILenum Format; // image format (in IL enum style)
56 | ILenum Type; // image type (in IL enum style)
57 | ILenum Origin; // origin of the image
58 | ILhandle Palette; // the image's palette
59 | ILenum PalType; // palette type
60 | ILuint PalSize; // palette size
61 | ILenum CubeFlags; // flags for what cube map sides are present
62 | ILuint NumNext; // number of images following
63 | ILuint NumMips; // number of mipmaps
64 | ILuint NumLayers; // number of layers
65 | }
66 |
67 | [StructLayout(LayoutKind.Sequential)]
68 | public struct ILPointf
69 | {
70 | ILfloat x;
71 | ILfloat y;
72 | }
73 |
74 | [StructLayout(LayoutKind.Sequential)]
75 | public struct ILPointi
76 | {
77 | ILint x;
78 | ILint y;
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/Source/Imaging/ILU.Wrappers.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : ilu.wrappers.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : Image Library Utility (ILU). This "imported header" (from C/C++)
6 | // defines wrappers for low level delegates and functions.
7 | // WEB : https://github.com/carmack78/opengldotnet
8 | // AUTHOR : TAYLAN INAN
9 | // E-MAIL : taylaninan@yahoo.com
10 | // DATE : 2014-2018
11 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
12 | // ----------------------------------------------------------------------------
13 |
14 | using System;
15 | using System.Runtime.InteropServices;
16 |
17 | using ILenum = System.UInt32;
18 | using ILboolean = System.Boolean;
19 | using ILbitfield = System.UInt32;
20 | using ILbyte = System.SByte;
21 | using ILshort = System.Int16;
22 | using ILint = System.Int32;
23 | using ILsizei = System.UInt32;
24 | using ILubyte = System.Byte;
25 | using ILushort = System.UInt16;
26 | using ILuint = System.UInt32;
27 | using ILfloat = System.Single;
28 | using ILclampf = System.Single;
29 | using ILdouble = System.Double;
30 | using ILclampd = System.Double;
31 | using ILint64 = System.Int64;
32 | using ILuint64 = System.UInt64;
33 | using ILchar = System.Byte;
34 | using ILstring = System.String;
35 | using ILconst_string = System.String;
36 | using ILhandle = System.IntPtr;
37 |
38 | namespace OpenGLDotNet
39 | {
40 | public static partial class ILU
41 | {
42 | ///////////////////////////////////////////////////////////////////////
43 | // DevIL/ILU v1.7.8 WRAPPERS
44 | ///////////////////////////////////////////////////////////////////////
45 | // ILAPI ILboolean ILAPIENTRY iluAlienify(void);
46 | public static ILboolean Alienify()
47 | {
48 | return iluAlienify();
49 | }
50 |
51 | // ILAPI ILboolean ILAPIENTRY iluBlurAvg(ILuint Iter);
52 | public static ILboolean BlurAvg(ILuint Iter)
53 | {
54 | return iluBlurAvg(Iter);
55 | }
56 |
57 | // ILAPI ILboolean ILAPIENTRY iluBlurGaussian(ILuint Iter);
58 | public static ILboolean BlurGaussian(ILuint Iter)
59 | {
60 | return iluBlurGaussian(Iter);
61 | }
62 |
63 | // ILAPI ILboolean ILAPIENTRY iluBuildMipmaps(void);
64 | public static ILboolean BuildMipMaps()
65 | {
66 | return iluBuildMipmaps();
67 | }
68 |
69 | // ILAPI ILuint ILAPIENTRY iluColoursUsed(void);
70 | public static ILuint ColoursUsed()
71 | {
72 | return iluColoursUsed();
73 | }
74 |
75 | // ILAPI ILboolean ILAPIENTRY iluCompareImage(ILuint Comp);
76 | public static ILboolean CompareImage(ILuint Comp)
77 | {
78 | return iluCompareImage(Comp);
79 | }
80 |
81 | // ILAPI ILboolean ILAPIENTRY iluContrast(ILfloat Contrast);
82 | public static ILboolean Contrast(ILfloat Contrast)
83 | {
84 | return iluContrast(Contrast);
85 | }
86 |
87 | // ILAPI ILboolean ILAPIENTRY iluCrop(ILuint XOff, ILuint YOff, ILuint ZOff, ILuint Width, ILuint Height, ILuint Depth);
88 | public static ILboolean Crop(ILuint XOff, ILuint YOff, ILuint ZOff, ILuint Width, ILuint Height, ILuint Depth)
89 | {
90 | return iluCrop(XOff, YOff, ZOff, Width, Height, Depth);
91 | }
92 |
93 | // ILAPI void ILAPIENTRY iluDeleteImage(ILuint Id); // Deprecated
94 | public static void DeleteImage(ILuint Id)
95 | {
96 | iluDeleteImage(Id);
97 | }
98 |
99 | // ILAPI ILboolean ILAPIENTRY iluEdgeDetectE(void);
100 | public static ILboolean EdgeDetectE()
101 | {
102 | return iluEdgeDetectE();
103 | }
104 |
105 | // ILAPI ILboolean ILAPIENTRY iluEdgeDetectP(void);
106 | public static ILboolean EdgeDetectP()
107 | {
108 | return iluEdgeDetectP();
109 | }
110 |
111 | // ILAPI ILboolean ILAPIENTRY iluEdgeDetectS(void);
112 | public static ILboolean EdgeDetectS()
113 | {
114 | return iluEdgeDetectS();
115 | }
116 |
117 | // ILAPI ILboolean ILAPIENTRY iluEmboss(void);
118 | public static ILboolean Emboss()
119 | {
120 | return iluEmboss();
121 | }
122 |
123 | // ILAPI ILboolean ILAPIENTRY iluEnlargeCanvas(ILuint Width, ILuint Height, ILuint Depth);
124 | public static ILboolean EnlargeCanvas(ILuint Width, ILuint Height, ILuint Depth)
125 | {
126 | return iluEnlargeCanvas(Width, Height, Depth);
127 | }
128 |
129 | // ILAPI ILboolean ILAPIENTRY iluEnlargeImage(ILfloat XDim, ILfloat YDim, ILfloat ZDim);
130 | public static ILboolean EnlargeImage(ILfloat XDim, ILfloat YDim, ILfloat ZDim)
131 | {
132 | return iluEnlargeImage(XDim, YDim, ZDim);
133 | }
134 |
135 | // ILAPI ILboolean ILAPIENTRY iluEqualize(void);
136 | public static ILboolean Equalize()
137 | {
138 | return iluEqualize();
139 | }
140 |
141 | // ILAPI ILconst_string ILAPIENTRY iluErrorString(ILenum Error);
142 | public unsafe static string ErrorString(ILenum Error)
143 | {
144 | return new string((sbyte*)iluErrorString(Error));
145 | }
146 |
147 | // ILAPI ILboolean ILAPIENTRY iluConvolution(ILint *matrix, ILint scale, ILint bias);
148 | public unsafe static ILboolean Convolution(ILint[] matrix, ILint scale, ILint bias)
149 | {
150 | fixed (ILint* ptr_matrix = matrix)
151 | {
152 | return iluConvolution(ptr_matrix, scale, bias);
153 | }
154 | }
155 |
156 | // ILAPI ILboolean ILAPIENTRY iluFlipImage(void);
157 | public static ILboolean FlipImage()
158 | {
159 | return iluFlipImage();
160 | }
161 |
162 | // ILAPI ILboolean ILAPIENTRY iluGammaCorrect(ILfloat Gamma);
163 | public static ILboolean GammaCorrect(ILfloat Gamma)
164 | {
165 | return iluGammaCorrect(Gamma);
166 | }
167 |
168 | // ILAPI ILuint ILAPIENTRY iluGenImage(void); // Deprecated
169 | public static ILuint GenImage()
170 | {
171 | return iluGenImage();
172 | }
173 |
174 | // ILAPI void ILAPIENTRY iluGetImageInfo(ILinfo *Info);
175 | public static void GetImageInfo(ILInfo Info)
176 | {
177 | iluGetImageInfo(Info);
178 | }
179 |
180 | // ILAPI ILint ILAPIENTRY iluGetInteger(ILenum Mode);
181 | public static ILint GetInteger(ILenum Mode)
182 | {
183 | return iluGetInteger(Mode);
184 | }
185 |
186 | // ILAPI void ILAPIENTRY iluGetIntegerv(ILenum Mode, ILint *Param);
187 | public unsafe static void GetIntegerv(ILenum Mode, ILint[] Param)
188 | {
189 | fixed (ILint* ptr_Param = Param)
190 | {
191 | iluGetIntegerv(Mode, ptr_Param);
192 | }
193 | }
194 |
195 | // ILAPI ILstring ILAPIENTRY iluGetString(ILenum StringName);
196 | public unsafe static string GetString(ILenum StringName)
197 | {
198 | return new string((sbyte*)iluGetString(StringName));
199 | }
200 |
201 | // ILAPI void ILAPIENTRY iluImageParameter(ILenum PName, ILenum Param);
202 | public static void ImageParameter(ILenum PName, ILenum Param)
203 | {
204 | iluImageParameter(PName, Param);
205 | }
206 |
207 | // ILAPI void ILAPIENTRY iluInit(void);
208 | public static void Init()
209 | {
210 | iluInit();
211 | }
212 |
213 | // ILAPI ILboolean ILAPIENTRY iluInvertAlpha(void);
214 | public static ILboolean InvertAlpha()
215 | {
216 | return iluInvertAlpha();
217 | }
218 |
219 | // ILAPI ILuint ILAPIENTRY iluLoadImage(ILconst_string FileName);
220 | public static ILuint LoadImage(ILconst_string FileName)
221 | {
222 | return iluLoadImage(FileName);
223 | }
224 |
225 | // ILAPI ILboolean ILAPIENTRY iluMirror(void);
226 | public static ILboolean Mirror()
227 | {
228 | return iluMirror();
229 | }
230 |
231 | // ILAPI ILboolean ILAPIENTRY iluNegative(void);
232 | public static ILboolean Negative()
233 | {
234 | return iluNegative();
235 | }
236 |
237 | // ILAPI ILboolean ILAPIENTRY iluNoisify(ILclampf Tolerance);
238 | public static ILboolean Noisify(ILclampf Tolerance)
239 | {
240 | return iluNoisify(Tolerance);
241 | }
242 |
243 | // ILAPI ILboolean ILAPIENTRY iluPixelize(ILuint PixSize);
244 | public static ILboolean Pixelize(ILuint PixSize)
245 | {
246 | return iluPixelize(PixSize);
247 | }
248 |
249 | // ILAPI void ILAPIENTRY iluRegionfv(ILpointf *Points, ILuint n);
250 | public unsafe static void Regionfv(ILPointf[] Points, ILuint n)
251 | {
252 | fixed (ILPointf* ptr_Points = Points)
253 | {
254 | iluRegionfv(ptr_Points, n);
255 | }
256 | }
257 |
258 | // ILAPI void ILAPIENTRY iluRegioniv(ILpointi *Points, ILuint n);
259 | public unsafe static void Regioniv(ILPointi[] Points, ILuint n)
260 | {
261 | fixed (ILPointi* ptr_Points = Points)
262 | {
263 | iluRegioniv(ptr_Points, n);
264 | }
265 | }
266 |
267 | // ILAPI ILboolean ILAPIENTRY iluReplaceColour(ILubyte Red, ILubyte Green, ILubyte Blue, ILfloat Tolerance);
268 | public static ILboolean ReplaceColour(ILubyte Red, ILubyte Green, ILubyte Blue, ILfloat Tolerance)
269 | {
270 | return iluReplaceColour(Red, Green, Blue, Tolerance);
271 | }
272 |
273 | // ILAPI ILboolean ILAPIENTRY iluRotate(ILfloat Angle);
274 | public static ILboolean Rotate(ILfloat Angle)
275 | {
276 | return iluRotate(Angle);
277 | }
278 |
279 | // ILAPI ILboolean ILAPIENTRY iluRotate3D(ILfloat x, ILfloat y, ILfloat z, ILfloat Angle);
280 | public static ILboolean Rotate3D(ILfloat x, ILfloat y, ILfloat z, ILfloat Angle)
281 | {
282 | return iluRotate3D(x, y, z, Angle);
283 | }
284 |
285 | // ILAPI ILboolean ILAPIENTRY iluSaturate1f(ILfloat Saturation);
286 | public static ILboolean Saturate1f(ILfloat Saturation)
287 | {
288 | return iluSaturate1f(Saturation);
289 | }
290 |
291 | // ILAPI ILboolean ILAPIENTRY iluSaturate4f(ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation);
292 | public static ILboolean Saturate4f(ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation)
293 | {
294 | return iluSaturate4f(r, g, b, Saturation);
295 | }
296 |
297 | // ILAPI ILboolean ILAPIENTRY iluScale(ILuint Width, ILuint Height, ILuint Depth);
298 | public static ILboolean Scale(ILuint Width, ILuint Height, ILuint Depth)
299 | {
300 | return iluScale(Width, Height, Depth);
301 | }
302 |
303 | // ILAPI ILboolean ILAPIENTRY iluScaleAlpha(ILfloat scale);
304 | public static ILboolean ScaleAlpha(ILfloat scale)
305 | {
306 | return iluScaleAlpha(scale);
307 | }
308 |
309 | // ILAPI ILboolean ILAPIENTRY iluScaleColours(ILfloat r, ILfloat g, ILfloat b);
310 | public static ILboolean ScaleColours(ILfloat r, ILfloat g, ILfloat b)
311 | {
312 | return iluScaleColours(r, g, b);
313 | }
314 |
315 | // ILAPI ILboolean ILAPIENTRY iluSetLanguage(ILenum Language);
316 | public static ILboolean SetLanguage(ILenum Language)
317 | {
318 | return iluSetLanguage(Language);
319 | }
320 |
321 | // ILAPI ILboolean ILAPIENTRY iluSharpen(ILfloat Factor, ILuint Iter);
322 | public static ILboolean Sharpen(ILfloat Factor, ILuint Iter)
323 | {
324 | return iluSharpen(Factor, Iter);
325 | }
326 |
327 | // ILAPI ILboolean ILAPIENTRY iluSwapColours(void);
328 | public static ILboolean SwapColours()
329 | {
330 | return iluSwapColours();
331 | }
332 |
333 | // ILAPI ILboolean ILAPIENTRY iluWave(ILfloat Angle);
334 | public static ILboolean Wave(ILfloat Angle)
335 | {
336 | return iluWave(Angle);
337 | }
338 | }
339 | }
340 |
--------------------------------------------------------------------------------
/Source/Imaging/ILUT.Constants.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : ilut.constants.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : Image Library Utility Toolkit(ILUT). This "imported header" (from C/C++)
6 | // defines required constants for use with ILUT.
7 | // WEB : https://github.com/carmack78/opengldotnet
8 | // AUTHOR : TAYLAN INAN
9 | // E-MAIL : taylaninan@yahoo.com
10 | // DATE : 2014-2018
11 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
12 | // ----------------------------------------------------------------------------
13 |
14 | using System;
15 |
16 | namespace OpenGLDotNet
17 | {
18 | public static partial class ILUT
19 | {
20 | ///////////////////////////////////////////////////////////////////////
21 | // DevIL/ILUT v1.7.8 CONSTANTS
22 | ///////////////////////////////////////////////////////////////////////
23 | // Version & Vendor Information
24 | public const byte ILUT_VERSION_1_7_8 = 1;
25 | public const byte ILUT_VERSION = 178;
26 |
27 | public const uint ILUT_VERSION_NUM = IL.IL_VERSION_NUM;
28 | public const uint ILUT_VENDOR = IL.IL_VENDOR;
29 |
30 | // Attribute Bits
31 | public const uint ILUT_OPENGL_BIT = 0x00000001;
32 | public const uint ILUT_D3D_BIT = 0x00000002;
33 | public const uint ILUT_ALL_ATTRIB_BITS = 0x000FFFFF;
34 |
35 | // Error Types
36 | public const uint ILUT_INVALID_ENUM = 0x0501;
37 | public const uint ILUT_OUT_OF_MEMORY = 0x0502;
38 | public const uint ILUT_INVALID_VALUE = 0x0505;
39 | public const uint ILUT_ILLEGAL_OPERATION = 0x0506;
40 | public const uint ILUT_INVALID_PARAM = 0x0509;
41 | public const uint ILUT_COULD_NOT_OPEN_FILE = 0x050A;
42 | public const uint ILUT_STACK_OVERFLOW = 0x050E;
43 | public const uint ILUT_STACK_UNDERFLOW = 0x050F;
44 | public const uint ILUT_BAD_DIMENSIONS = 0x0511;
45 | public const uint ILUT_NOT_SUPPORTED = 0x0550;
46 |
47 | // State Definitions
48 | public const uint ILUT_PALETTE_MODE = 0x0600;
49 | public const uint ILUT_OPENGL_CONV = 0x0610;
50 | public const uint ILUT_D3D_MIPLEVELS = 0x0620;
51 | public const uint ILUT_MAXTEX_WIDTH = 0x0630;
52 | public const uint ILUT_MAXTEX_HEIGHT = 0x0631;
53 | public const uint ILUT_MAXTEX_DEPTH = 0x0632;
54 | public const uint ILUT_GL_USE_S3TC = 0x0634;
55 | public const uint ILUT_D3D_USE_DXTC = 0x0634;
56 | public const uint ILUT_GL_GEN_S3TC = 0x0635;
57 | public const uint ILUT_D3D_GEN_DXTC = 0x0635;
58 | public const uint ILUT_S3TC_FORMAT = 0x0705;
59 | public const uint ILUT_DXTC_FORMAT = 0x0705;
60 | public const uint ILUT_D3D_POOL = 0x0706;
61 | public const uint ILUT_D3D_ALPHA_KEY_COLOR = 0x0707;
62 | public const uint ILUT_D3D_ALPHA_KEY_COLOUR = 0x0707;
63 | public const uint ILUT_FORCE_INTEGER_FORMAT = 0x0636;
64 |
65 | // This new state does automatic texture target detection
66 | // if enabled. Currently, only cubemap detection is supported.
67 | // if the current image is no cubemap, the 2d texture is chosen.
68 | public const uint ILUT_GL_AUTODETECT_TEXTURE_TARGET = 0x0807;
69 |
70 | // The different rendering api's...
71 | // IMPORTANT NOTE: Only OPENGL and WIN32 rendering targets are supported by this C# library
72 | public const uint ILUT_OPENGL = 0;
73 | public const uint ILUT_ALLEGRO = 1;
74 | public const uint ILUT_WIN32 = 2;
75 | public const uint ILUT_DIRECT3D8 = 3;
76 | public const uint ILUT_DIRECT3D9 = 4;
77 | public const uint ILUT_X11 = 5;
78 | public const uint ILUT_DIRECT3D10 = 6;
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/Source/Imaging/ILUT.Functions.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : ilut.functions.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : Image Library Utility Toolkit(ILUT). This "imported header" (from C/C++)
6 | // defines and imports low level C/C++ delegates and functions as close to
7 | // C/C++.
8 | // WEB : https://github.com/carmack78/opengldotnet
9 | // AUTHOR : TAYLAN INAN
10 | // E-MAIL : taylaninan@yahoo.com
11 | // DATE : 2014-2018
12 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
13 | // ----------------------------------------------------------------------------
14 |
15 | using System;
16 | using System.Runtime.InteropServices;
17 |
18 | using ILenum = System.UInt32;
19 | using ILboolean = System.Boolean;
20 | using ILbitfield = System.UInt32;
21 | using ILbyte = System.SByte;
22 | using ILshort = System.Int16;
23 | using ILint = System.Int32;
24 | using ILsizei = System.UInt32;
25 | using ILubyte = System.Byte;
26 | using ILushort = System.UInt16;
27 | using ILuint = System.UInt32;
28 | using ILfloat = System.Single;
29 | using ILclampf = System.Single;
30 | using ILdouble = System.Double;
31 | using ILclampd = System.Double;
32 | using ILint64 = System.Int64;
33 | using ILuint64 = System.UInt64;
34 | using ILchar = System.Byte;
35 | using ILstring = System.String;
36 | using ILconst_string = System.String;
37 | using ILhandle = System.IntPtr;
38 |
39 | namespace OpenGLDotNet
40 | {
41 | public static partial class ILUT
42 | {
43 | ///////////////////////////////////////////////////////////////////////
44 | // DevIL/ILUT v1.7.8 FUNCTIONS
45 | ///////////////////////////////////////////////////////////////////////
46 | //---------------------------------------------------------------------
47 | // ImageLib Utility Toolkit Functions
48 | //---------------------------------------------------------------------
49 | // ILAPI ILboolean ILAPIENTRY ilutDisable(ILenum Mode);
50 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
51 | [System.Security.SuppressUnmanagedCodeSecurity()]
52 | private static extern ILboolean ilutDisable(ILenum Mode);
53 |
54 | // ILAPI ILboolean ILAPIENTRY ilutEnable(ILenum Mode);
55 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
56 | [System.Security.SuppressUnmanagedCodeSecurity()]
57 | private static extern ILboolean ilutEnable(ILenum Mode);
58 |
59 | // ILAPI ILboolean ILAPIENTRY ilutGetBoolean(ILenum Mode);
60 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
61 | [System.Security.SuppressUnmanagedCodeSecurity()]
62 | private static extern ILboolean ilutGetBoolean(ILenum Mode);
63 |
64 | // ILAPI void ILAPIENTRY ilutGetBooleanv(ILenum Mode, ILboolean *Param);
65 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
66 | [System.Security.SuppressUnmanagedCodeSecurity()]
67 | private unsafe static extern void ilutGetBooleanv(ILenum Mode, ILboolean* Param);
68 |
69 | // ILAPI ILint ILAPIENTRY ilutGetInteger(ILenum Mode);
70 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
71 | [System.Security.SuppressUnmanagedCodeSecurity()]
72 | private static extern ILint ilutGetInteger(ILenum Mode);
73 |
74 | // ILAPI void ILAPIENTRY ilutGetIntegerv(ILenum Mode, ILint *Param);
75 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
76 | [System.Security.SuppressUnmanagedCodeSecurity()]
77 | private unsafe static extern void ilutGetIntegerv(ILenum Mode, ILint* Param);
78 |
79 | // ILAPI ILstring ILAPIENTRY ilutGetString(ILenum StringName);
80 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
81 | [System.Security.SuppressUnmanagedCodeSecurity()]
82 | private unsafe static extern ILchar* ilutGetString(ILenum StringName);
83 |
84 | // ILAPI void ILAPIENTRY ilutInit(void);
85 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
86 | [System.Security.SuppressUnmanagedCodeSecurity()]
87 | private static extern void ilutInit();
88 |
89 | // ILAPI ILboolean ILAPIENTRY ilutIsDisabled(ILenum Mode);
90 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
91 | [System.Security.SuppressUnmanagedCodeSecurity()]
92 | private static extern ILboolean ilutIsDisabled(ILenum Mode);
93 |
94 | // ILAPI ILboolean ILAPIENTRY ilutIsEnabled(ILenum Mode);
95 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
96 | [System.Security.SuppressUnmanagedCodeSecurity()]
97 | private static extern ILboolean ilutIsEnabled(ILenum Mode);
98 |
99 | // ILAPI void ILAPIENTRY ilutPopAttrib(void);
100 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
101 | [System.Security.SuppressUnmanagedCodeSecurity()]
102 | private static extern void ilutPopAttrib();
103 |
104 | // ILAPI void ILAPIENTRY ilutPushAttrib(ILuint Bits);
105 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
106 | [System.Security.SuppressUnmanagedCodeSecurity()]
107 | private static extern void ilutPushAttrib(ILuint Bits);
108 |
109 | // ILAPI void ILAPIENTRY ilutSetInteger(ILenum Mode, ILint Param);
110 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
111 | [System.Security.SuppressUnmanagedCodeSecurity()]
112 | private static extern void ilutSetInteger(ILenum Mode, ILint Param);
113 |
114 | // ILAPI ILboolean ILAPIENTRY ilutRenderer(ILenum Renderer);
115 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
116 | [System.Security.SuppressUnmanagedCodeSecurity()]
117 | private static extern ILboolean ilutRenderer(ILenum Renderer);
118 |
119 | //---------------------------------------------------------------------
120 | // ImageLib Utility Toolkit's OpenGL Functions
121 | //---------------------------------------------------------------------
122 | // ILAPI GLuint ILAPIENTRY ilutGLBindTexImage();
123 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
124 | [System.Security.SuppressUnmanagedCodeSecurity()]
125 | private static extern ILuint ilutGLBindTexImage();
126 |
127 | // ILAPI GLuint ILAPIENTRY ilutGLBindMipmaps(void);
128 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
129 | [System.Security.SuppressUnmanagedCodeSecurity()]
130 | private static extern ILuint ilutGLBindMipmaps();
131 |
132 | // ILAPI ILboolean ILAPIENTRY ilutGLBuildMipmaps(void);
133 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
134 | [System.Security.SuppressUnmanagedCodeSecurity()]
135 | private static extern ILboolean ilutGLBuildMipmaps();
136 |
137 | // ILAPI GLuint ILAPIENTRY ilutGLLoadImage(ILstring FileName);
138 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
139 | [System.Security.SuppressUnmanagedCodeSecurity()]
140 | private static extern ILuint ilutGLLoadImage(ILstring FileName);
141 |
142 | // ILAPI ILboolean ILAPIENTRY ilutGLScreen(void);
143 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
144 | [System.Security.SuppressUnmanagedCodeSecurity()]
145 | private static extern ILboolean ilutGLScreen();
146 |
147 | // ILAPI ILboolean ILAPIENTRY ilutGLScreenie(void);
148 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
149 | [System.Security.SuppressUnmanagedCodeSecurity()]
150 | private static extern ILboolean ilutGLScreenie();
151 |
152 | // ILAPI ILboolean ILAPIENTRY ilutGLSaveImage(ILstring FileName, GLuint TexID);
153 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
154 | [System.Security.SuppressUnmanagedCodeSecurity()]
155 | private static extern ILboolean ilutGLSaveImage(ILstring FileName, ILuint TexID);
156 |
157 | // ILAPI ILboolean ILAPIENTRY ilutGLSubTex2D(GLuint TexID, ILuint XOff, ILuint YOff);
158 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
159 | [System.Security.SuppressUnmanagedCodeSecurity()]
160 | private static extern ILboolean ilutGLSubTex2D(ILuint TexID, ILuint XOff, ILuint YOff);
161 |
162 | // ILAPI ILboolean ILAPIENTRY ilutGLSubTex3D(GLuint TexID, ILuint XOff, ILuint YOff, ILuint ZOff);
163 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
164 | [System.Security.SuppressUnmanagedCodeSecurity()]
165 | private static extern ILboolean ilutGLSubTex3D(ILuint TexID, ILuint XOff, ILuint YOff, ILuint ZOff);
166 |
167 | // ILAPI ILboolean ILAPIENTRY ilutGLSetTex2D(GLuint TexID);
168 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
169 | [System.Security.SuppressUnmanagedCodeSecurity()]
170 | private static extern ILboolean ilutGLSetTex2D(ILuint TexID);
171 |
172 | // ILAPI ILboolean ILAPIENTRY ilutGLSetTex3D(GLuint TexID);
173 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
174 | [System.Security.SuppressUnmanagedCodeSecurity()]
175 | private static extern ILboolean ilutGLSetTex3D(ILuint TexID);
176 |
177 | // ILAPI ILboolean ILAPIENTRY ilutGLTexImage(GLuint Level);
178 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
179 | [System.Security.SuppressUnmanagedCodeSecurity()]
180 | private static extern ILboolean ilutGLTexImage(ILuint Level);
181 |
182 | // ILAPI ILboolean ILAPIENTRY ilutGLSetTex(GLuint TexID); // Deprecated - use ilutGLSetTex2D.
183 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
184 | [System.Security.SuppressUnmanagedCodeSecurity()]
185 | private static extern ILboolean ilutGLSetTex(ILuint TexID);
186 |
187 | // ILAPI ILboolean ILAPIENTRY ilutGLSubTex(GLuint TexID, ILuint XOff, ILuint YOff); // Use ilutGLSubTex2D.
188 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
189 | [System.Security.SuppressUnmanagedCodeSecurity()]
190 | private static extern ILboolean ilutGLSubTex(ILuint TexID, ILuint XOff, ILuint YOff);
191 |
192 | //---------------------------------------------------------------------
193 | // ImageLib Utility Toolkit's Win32 GDI Functions
194 | //---------------------------------------------------------------------
195 | // ILAPI HBITMAP ILAPIENTRY ilutConvertToHBitmap(HDC hDC);
196 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
197 | [System.Security.SuppressUnmanagedCodeSecurity()]
198 | private static extern IntPtr ilutConvertToHBitmap(IntPtr hDC);
199 |
200 | // ILAPI HBITMAP ILAPIENTRY ilutConvertSliceToHBitmap(HDC hDC, ILuint slice);
201 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
202 | [System.Security.SuppressUnmanagedCodeSecurity()]
203 | private static extern IntPtr ilutConvertSliceToHBitmap(IntPtr hDC, ILuint slice);
204 |
205 | // ILAPI void ILAPIENTRY ilutFreePaddedData(ILubyte *Data);
206 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
207 | [System.Security.SuppressUnmanagedCodeSecurity()]
208 | private static extern void ilutFreePaddedData(IntPtr Data);
209 |
210 | // ILAPI void ILAPIENTRY ilutGetBmpInfo(BITMAPINFO *Info);
211 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
212 | [System.Security.SuppressUnmanagedCodeSecurity()]
213 | private static extern void ilutGetBmpInfo([MarshalAs(UnmanagedType.LPStruct)] BITMAPINFO Info);
214 |
215 | // ILAPI HPALETTE ILAPIENTRY ilutGetHPal(void);
216 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
217 | [System.Security.SuppressUnmanagedCodeSecurity()]
218 | private static extern IntPtr ilutGetHPal();
219 |
220 | // ILAPI ILubyte* ILAPIENTRY ilutGetPaddedData(void);
221 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
222 | [System.Security.SuppressUnmanagedCodeSecurity()]
223 | private static extern IntPtr ilutGetPaddedData();
224 |
225 | // ILAPI ILboolean ILAPIENTRY ilutGetWinClipboard(void);
226 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
227 | [System.Security.SuppressUnmanagedCodeSecurity()]
228 | private static extern ILboolean ilutGetWinClipboard();
229 |
230 | // ILAPI ILboolean ILAPIENTRY ilutLoadResource(HINSTANCE hInst, ILint ID, ILstring ResourceType, ILenum Type);
231 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
232 | [System.Security.SuppressUnmanagedCodeSecurity()]
233 | private static extern ILboolean ilutLoadResource(IntPtr hInstance, ILint ID, ILstring ResourceType, ILenum Type);
234 |
235 | // ILAPI ILboolean ILAPIENTRY ilutSetHBitmap(HBITMAP Bitmap);
236 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
237 | [System.Security.SuppressUnmanagedCodeSecurity()]
238 | private static extern ILboolean ilutSetHBitmap(IntPtr BitMap);
239 |
240 | // ILAPI ILboolean ILAPIENTRY ilutSetHPal(HPALETTE Pal);
241 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
242 | [System.Security.SuppressUnmanagedCodeSecurity()]
243 | private static extern ILboolean ilutSetHPal(IntPtr Pal);
244 |
245 | // ILAPI ILboolean ILAPIENTRY ilutSetWinClipboard(void);
246 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
247 | [System.Security.SuppressUnmanagedCodeSecurity()]
248 | private static extern ILboolean ilutSetWinClipboard();
249 |
250 | // ILAPI HBITMAP ILAPIENTRY ilutWinLoadImage(ILstring FileName, HDC hDC);
251 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
252 | [System.Security.SuppressUnmanagedCodeSecurity()]
253 | private static extern IntPtr ilutWinLoadImage(ILstring FileName, IntPtr hDC);
254 |
255 | // ILAPI ILboolean ILAPIENTRY ilutWinLoadUrl(ILstring Url);
256 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
257 | [System.Security.SuppressUnmanagedCodeSecurity()]
258 | private static extern ILboolean ilutWinLoadUrl(ILstring Url);
259 |
260 | // ILAPI ILboolean ILAPIENTRY ilutWinPrint(ILuint XPos, ILuint YPos, ILuint Width, ILuint Height, HDC hDC);
261 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall)]
262 | [System.Security.SuppressUnmanagedCodeSecurity()]
263 | private static extern ILboolean ilutWinPrint(ILuint XPos, ILuint YPos, ILuint Width, ILuint Height, IntPtr hDC);
264 |
265 | // ILAPI ILboolean ILAPIENTRY ilutWinSaveImage(ILstring FileName, HBITMAP Bitmap);
266 | [DllImport("ILUT.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
267 | [System.Security.SuppressUnmanagedCodeSecurity()]
268 | private static extern ILboolean ilutWinSaveImage(ILstring FileName, IntPtr Bitmap);
269 | }
270 | }
271 |
--------------------------------------------------------------------------------
/Source/Imaging/ILUT.Types.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : ilut.types.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : Image Library Utility Toolkit(ILUT). This "imported header" (from C/C++)
6 | // defines required types for use with ILUT.
7 | // WEB : https://github.com/carmack78/opengldotnet
8 | // AUTHOR : TAYLAN INAN
9 | // E-MAIL : taylaninan@yahoo.com
10 | // DATE : 2014-2018
11 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
12 | // ----------------------------------------------------------------------------
13 |
14 | using System;
15 | using System.Runtime.InteropServices;
16 |
17 | using BYTE = System.Byte;
18 | using WORD = System.UInt16;
19 | using DWORD = System.UInt32;
20 | using LONG = System.Int32;
21 |
22 | namespace OpenGLDotNet
23 | {
24 | public static partial class ILUT
25 | {
26 | ///////////////////////////////////////////////////////////////////////
27 | // DevIL/ILUT v1.7.8 TYPES
28 | ///////////////////////////////////////////////////////////////////////
29 | [StructLayout(LayoutKind.Sequential)]
30 | public struct BITMAPINFOHEADER
31 | {
32 | DWORD biSize;
33 | LONG biWidth;
34 | LONG biHeight;
35 | WORD biPlanes;
36 | WORD biBitCount;
37 | DWORD biCompression;
38 | DWORD biSizeImage;
39 | LONG biXPelsPerMeter;
40 | LONG biYPelsPerMeter;
41 | DWORD biClrUsed;
42 | DWORD biClrImportant;
43 | }
44 |
45 | [StructLayout(LayoutKind.Sequential)]
46 | public struct RGBQUAD
47 | {
48 | BYTE rgbBlue;
49 | BYTE rgbGreen;
50 | BYTE rgbRed;
51 | BYTE rgbReserved;
52 | }
53 |
54 | [StructLayout(LayoutKind.Sequential)]
55 | public class BITMAPINFO
56 | {
57 | BITMAPINFOHEADER bmiHeader;
58 | RGBQUAD bmiColors;
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Source/Imaging/ILUT.Wrappers.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : ilut.wrappers.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : Image Library Utility Toolkit(ILUT). This "imported header" (from C/C++)
6 | // defines wrappers for low level delegates and functions.
7 | // WEB : https://github.com/carmack78/opengldotnet
8 | // AUTHOR : TAYLAN INAN
9 | // E-MAIL : taylaninan@yahoo.com
10 | // DATE : 2014-2018
11 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
12 | // ----------------------------------------------------------------------------
13 |
14 | using System;
15 | using System.Runtime.InteropServices;
16 |
17 | using ILenum = System.UInt32;
18 | using ILboolean = System.Boolean;
19 | using ILbitfield = System.UInt32;
20 | using ILbyte = System.SByte;
21 | using ILshort = System.Int16;
22 | using ILint = System.Int32;
23 | using ILsizei = System.UInt32;
24 | using ILubyte = System.Byte;
25 | using ILushort = System.UInt16;
26 | using ILuint = System.UInt32;
27 | using ILfloat = System.Single;
28 | using ILclampf = System.Single;
29 | using ILdouble = System.Double;
30 | using ILclampd = System.Double;
31 | using ILint64 = System.Int64;
32 | using ILuint64 = System.UInt64;
33 | using ILchar = System.Byte;
34 | using ILstring = System.String;
35 | using ILconst_string = System.String;
36 | using ILhandle = System.IntPtr;
37 |
38 | namespace OpenGLDotNet
39 | {
40 | public static partial class ILUT
41 | {
42 | ///////////////////////////////////////////////////////////////////////
43 | // DevIL/ILUT v1.7.8 WRAPPERS
44 | ///////////////////////////////////////////////////////////////////////
45 | //---------------------------------------------------------------------
46 | // ImageLib Utility Toolkit Functions
47 | //---------------------------------------------------------------------
48 | // ILAPI ILboolean ILAPIENTRY ilutDisable(ILenum Mode);
49 | public static ILboolean Disable(ILenum Mode)
50 | {
51 | return ilutDisable(Mode);
52 | }
53 |
54 | // ILAPI ILboolean ILAPIENTRY ilutEnable(ILenum Mode);
55 | public static ILboolean Enable(ILenum Mode)
56 | {
57 | return ilutEnable(Mode);
58 | }
59 |
60 | // ILAPI ILboolean ILAPIENTRY ilutGetBoolean(ILenum Mode);
61 | public static ILboolean GetBoolean(ILenum Mode)
62 | {
63 | return ilutGetBoolean(Mode);
64 | }
65 |
66 | // ILAPI void ILAPIENTRY ilutGetBooleanv(ILenum Mode, ILboolean *Param);
67 | public unsafe static void GetBooleanv(ILenum Mode, ILboolean[] Param)
68 | {
69 | fixed (ILboolean* ptr_Param = Param)
70 | {
71 | ilutGetBooleanv(Mode, ptr_Param);
72 | }
73 | }
74 |
75 | // ILAPI ILint ILAPIENTRY ilutGetInteger(ILenum Mode);
76 | public static ILint GetInteger(ILenum Mode)
77 | {
78 | return ilutGetInteger(Mode);
79 | }
80 |
81 | // ILAPI void ILAPIENTRY ilutGetIntegerv(ILenum Mode, ILint *Param);
82 | public unsafe static void GetIntegerv(ILenum Mode, ILint[] Param)
83 | {
84 | fixed (ILint* ptr_Param = Param)
85 | {
86 | ilutGetIntegerv(Mode, ptr_Param);
87 | }
88 | }
89 |
90 | // ILAPI ILstring ILAPIENTRY ilutGetString(ILenum StringName);
91 | public unsafe static string GetString(ILenum StringName)
92 | {
93 | return new string((sbyte*)ilutGetString(StringName));
94 | }
95 |
96 | // ILAPI void ILAPIENTRY ilutInit(void);
97 | public static void Init()
98 | {
99 | ilutInit();
100 | }
101 |
102 | // ILAPI ILboolean ILAPIENTRY ilutIsDisabled(ILenum Mode);
103 | public static ILboolean IsDisabled(ILenum Mode)
104 | {
105 | return ilutIsDisabled(Mode);
106 | }
107 |
108 | // ILAPI ILboolean ILAPIENTRY ilutIsEnabled(ILenum Mode);
109 | public static ILboolean IsEnabled(ILenum Mode)
110 | {
111 | return ilutIsEnabled(Mode);
112 | }
113 |
114 | // ILAPI void ILAPIENTRY ilutPopAttrib(void);
115 | public static void PopAttrib()
116 | {
117 | ilutPopAttrib();
118 | }
119 |
120 | // ILAPI void ILAPIENTRY ilutPushAttrib(ILuint Bits);
121 | public static void PushAttrib(ILuint Bits)
122 | {
123 | ilutPushAttrib(Bits);
124 | }
125 |
126 | // ILAPI void ILAPIENTRY ilutSetInteger(ILenum Mode, ILint Param);
127 | public static void SetInteger(ILenum Mode, ILint Param)
128 | {
129 | ilutSetInteger(Mode, Param);
130 | }
131 |
132 | // ILAPI ILboolean ILAPIENTRY ilutRenderer(ILenum Renderer);
133 | public static void Renderer(ILenum Renderer)
134 | {
135 | ilutRenderer(Renderer);
136 | }
137 |
138 | //---------------------------------------------------------------------
139 | // ImageLib Utility Toolkit's OpenGL Functions
140 | //---------------------------------------------------------------------
141 | // ILAPI GLuint ILAPIENTRY ilutGLBindTexImage();
142 | public static ILuint GLBindTexImage()
143 | {
144 | return ilutGLBindTexImage();
145 | }
146 |
147 | // ILAPI GLuint ILAPIENTRY ilutGLBindMipmaps(void);
148 | public static ILuint GLBindMipmaps()
149 | {
150 | return ilutGLBindMipmaps();
151 | }
152 |
153 | // ILAPI ILboolean ILAPIENTRY ilutGLBuildMipmaps(void);
154 | public static ILboolean GLBuildMipmaps()
155 | {
156 | return ilutGLBuildMipmaps();
157 | }
158 |
159 | // ILAPI GLuint ILAPIENTRY ilutGLLoadImage(ILstring FileName);
160 | public static ILuint GLLoadImage(ILstring FileName)
161 | {
162 | return ilutGLLoadImage(FileName);
163 | }
164 |
165 | // ILAPI ILboolean ILAPIENTRY ilutGLScreen(void);
166 | public static ILboolean GLScreen()
167 | {
168 | return ilutGLScreen();
169 | }
170 |
171 | // ILAPI ILboolean ILAPIENTRY ilutGLScreenie(void);
172 | public static ILboolean GLScreenie()
173 | {
174 | return ilutGLScreenie();
175 | }
176 |
177 | // ILAPI ILboolean ILAPIENTRY ilutGLSaveImage(ILstring FileName, GLuint TexID);
178 | public static ILboolean GLSaveImage(ILstring FileName, ILuint TexID)
179 | {
180 | return ilutGLSaveImage(FileName, TexID);
181 | }
182 |
183 | // ILAPI ILboolean ILAPIENTRY ilutGLSubTex2D(GLuint TexID, ILuint XOff, ILuint YOff);
184 | public static ILboolean GLSubTex2D(ILuint TexID, ILuint XOff, ILuint YOff)
185 | {
186 | return ilutGLSubTex2D(TexID, XOff, YOff);
187 | }
188 |
189 | // ILAPI ILboolean ILAPIENTRY ilutGLSubTex3D(GLuint TexID, ILuint XOff, ILuint YOff, ILuint ZOff);
190 | public static ILboolean GLSubTex3D(ILuint TexID, ILuint XOff, ILuint YOff, ILuint ZOff)
191 | {
192 | return ilutGLSubTex3D(TexID, XOff, YOff, ZOff);
193 | }
194 |
195 | // ILAPI ILboolean ILAPIENTRY ilutGLSetTex2D(GLuint TexID);
196 | public static ILboolean GLSetTex2D(ILuint TexID)
197 | {
198 | return ilutGLSetTex2D(TexID);
199 | }
200 |
201 | // ILAPI ILboolean ILAPIENTRY ilutGLSetTex3D(GLuint TexID);
202 | public static ILboolean GLSetTex3D(ILuint TexID)
203 | {
204 | return ilutGLSetTex3D(TexID);
205 | }
206 |
207 | // ILAPI ILboolean ILAPIENTRY ilutGLTexImage(GLuint Level);
208 | public static ILboolean GLTexImage(ILuint Level)
209 | {
210 | return ilutGLTexImage(Level);
211 | }
212 |
213 | // ILAPI ILboolean ILAPIENTRY ilutGLSetTex(GLuint TexID); // Deprecated - use ilutGLSetTex2D.
214 | public static ILboolean GLSetTex(ILuint TexID)
215 | {
216 | return ilutGLSetTex(TexID);
217 | }
218 |
219 | // ILAPI ILboolean ILAPIENTRY ilutGLSubTex(GLuint TexID, ILuint XOff, ILuint YOff); // Use ilutGLSubTex2D.
220 | public static ILboolean GLSubTex(ILuint TexID, ILuint XOff, ILuint YOff)
221 | {
222 | return ilutGLSubTex(TexID, XOff, YOff);
223 | }
224 |
225 | //---------------------------------------------------------------------
226 | // ImageLib Utility Toolkit's Win32 GDI Functions
227 | //---------------------------------------------------------------------
228 | // ILAPI HBITMAP ILAPIENTRY ilutConvertToHBitmap(HDC hDC);
229 | public static IntPtr ConvertToHBitmap(IntPtr hDC)
230 | {
231 | return ilutConvertToHBitmap(hDC);
232 | }
233 |
234 | // ILAPI HBITMAP ILAPIENTRY ilutConvertSliceToHBitmap(HDC hDC, ILuint slice);
235 | public static IntPtr ConvertSliceToHBitmap(IntPtr hDC, ILuint slice)
236 | {
237 | return ilutConvertSliceToHBitmap(hDC, slice);
238 | }
239 |
240 | // ILAPI void ILAPIENTRY ilutFreePaddedData(ILubyte *Data);
241 | public static void FreePaddedData(IntPtr Data)
242 | {
243 | ilutFreePaddedData(Data);
244 | }
245 |
246 | // ILAPI void ILAPIENTRY ilutGetBmpInfo(BITMAPINFO *Info);
247 | public static void GetBmpInfo(BITMAPINFO Info)
248 | {
249 | ilutGetBmpInfo(Info);
250 | }
251 |
252 | // ILAPI HPALETTE ILAPIENTRY ilutGetHPal(void);
253 | public static IntPtr GetHPal()
254 | {
255 | return ilutGetHPal();
256 | }
257 |
258 | // ILAPI ILubyte* ILAPIENTRY ilutGetPaddedData(void);
259 | public static IntPtr GetPaddedData()
260 | {
261 | return ilutGetPaddedData();
262 | }
263 |
264 | // ILAPI ILboolean ILAPIENTRY ilutGetWinClipboard(void);
265 | public static ILboolean GetWinClipboard()
266 | {
267 | return ilutGetWinClipboard();
268 | }
269 |
270 | // ILAPI ILboolean ILAPIENTRY ilutLoadResource(HINSTANCE hInst, ILint ID, ILstring ResourceType, ILenum Type);
271 | public static ILboolean LoadResource(IntPtr hInstance, ILint ID, ILstring ResourceType, ILenum Type)
272 | {
273 | return ilutLoadResource(hInstance, ID, ResourceType, Type);
274 | }
275 |
276 | // ILAPI ILboolean ILAPIENTRY ilutSetHBitmap(HBITMAP Bitmap);
277 | public static ILboolean SetHBitmap(IntPtr Bitmap)
278 | {
279 | return ilutSetHBitmap(Bitmap);
280 | }
281 |
282 | // ILAPI ILboolean ILAPIENTRY ilutSetHPal(HPALETTE Pal);
283 | public static ILboolean SetHPal(IntPtr Pal)
284 | {
285 | return ilutSetHPal(Pal);
286 | }
287 |
288 | // ILAPI ILboolean ILAPIENTRY ilutSetWinClipboard(void);
289 | public static ILboolean SetWinClipboard()
290 | {
291 | return ilutSetWinClipboard();
292 | }
293 |
294 | // ILAPI HBITMAP ILAPIENTRY ilutWinLoadImage(ILstring FileName, HDC hDC);
295 | public static IntPtr WinLoadImage(ILstring FileName, IntPtr hDC)
296 | {
297 | return ilutWinLoadImage(FileName, hDC);
298 | }
299 |
300 | // ILAPI ILboolean ILAPIENTRY ilutWinLoadUrl(ILstring Url);
301 | public static ILboolean WinLoadUrl(ILstring Url)
302 | {
303 | return ilutWinLoadUrl(Url);
304 | }
305 |
306 | // ILAPI ILboolean ILAPIENTRY ilutWinPrint(ILuint XPos, ILuint YPos, ILuint Width, ILuint Height, HDC hDC);
307 | public static ILboolean WinPrint(ILuint XPos, ILuint YPos, ILuint Width, ILuint Height, IntPtr hDC)
308 | {
309 | return ilutWinPrint(XPos, YPos, Width, Height, hDC);
310 | }
311 |
312 | // ILAPI ILboolean ILAPIENTRY ilutWinSaveImage(ILstring FileName, HBITMAP Bitmap);
313 | public static ILboolean WinSaveImage(ILstring FileName, IntPtr Bitmap)
314 | {
315 | return ilutWinSaveImage(FileName, Bitmap);
316 | }
317 | }
318 | }
319 |
--------------------------------------------------------------------------------
/Source/OpenGL/GLU.Constants.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : glu.constants.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : OpenGL Utility (GLU) library constants.
6 | // WEB : https://github.com/carmack78/opengldotnet
7 | // AUTHOR : TAYLAN INAN
8 | // E-MAIL : taylaninan@yahoo.com
9 | // DATE : 2014-2018
10 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
11 | // ----------------------------------------------------------------------------
12 |
13 | using System;
14 |
15 | namespace OpenGLDotNet
16 | {
17 | public static partial class GLU
18 | {
19 | ///////////////////////////////////////////////////////////////////////
20 | // GLU CONSTANTS
21 | ///////////////////////////////////////////////////////////////////////
22 | /**** Generic constants ****/
23 | /* Version */
24 | public const bool GLU_VERSION_1_1 = true;
25 | public const bool GLU_VERSION_1_2 = true;
26 |
27 | /* Errors: (return value 0 = no error) */
28 | public const uint GLU_INVALID_ENUM = 100900;
29 | public const uint GLU_INVALID_VALUE = 100901;
30 | public const uint GLU_OUT_OF_MEMORY = 100902;
31 | public const uint GLU_INCOMPATIBLE_GL_VERSION = 100903;
32 |
33 | /* StringName */
34 | public const uint GLU_VERSION = 100800;
35 | public const uint GLU_EXTENSIONS = 100801;
36 |
37 | /* Boolean */
38 | public const uint GLU_TRUE = 1; // equals to GL_TRUE
39 | public const uint GLU_FALSE = 0; // equals to GL_FALSE
40 |
41 | /**** Quadric constants ****/
42 | /* QuadricNormal */
43 | public const uint GLU_SMOOTH = 100000;
44 | public const uint GLU_FLAT = 100001;
45 | public const uint GLU_NONE = 100002;
46 |
47 | /* QuadricDrawStyle */
48 | public const uint GLU_POINT = 100010;
49 | public const uint GLU_LINE = 100011;
50 | public const uint GLU_FILL = 100012;
51 | public const uint GLU_SILHOUETTE = 100013;
52 |
53 | /* QuadricOrientation */
54 | public const uint GLU_OUTSIDE = 100020;
55 | public const uint GLU_INSIDE = 100021;
56 |
57 | /* Callback types: */
58 | /* GLU_ERROR 100103 */
59 |
60 | /**** Tesselation constants ****/
61 | public const double GLU_TESS_MAX_COORD = 1.0e150;
62 |
63 | /* TessProperty */
64 | public const uint GLU_TESS_WINDING_RULE = 100140;
65 | public const uint GLU_TESS_BOUNDARY_ONLY = 100141;
66 | public const uint GLU_TESS_TOLERANCE = 100142;
67 |
68 | /* TessWinding */
69 | public const uint GLU_TESS_WINDING_ODD = 100130;
70 | public const uint GLU_TESS_WINDING_NONZERO = 100131;
71 | public const uint GLU_TESS_WINDING_POSITIVE = 100132;
72 | public const uint GLU_TESS_WINDING_NEGATIVE = 100133;
73 | public const uint GLU_TESS_WINDING_ABS_GEQ_TWO = 100134;
74 |
75 | /* TessCallback */
76 | public const uint GLU_TESS_BEGIN = 100100; /* void (CALLBACK*)(GLenum type) */
77 | public const uint GLU_TESS_VERTEX = 100101; /* void (CALLBACK*)(void *data) */
78 | public const uint GLU_TESS_END = 100102; /* void (CALLBACK*)(void) */
79 | public const uint GLU_TESS_ERROR = 100103; /* void (CALLBACK*)(GLenum errno) */
80 | public const uint GLU_TESS_EDGE_FLAG = 100104; /* void (CALLBACK*)(GLboolean boundaryEdge) */
81 | public const uint GLU_TESS_COMBINE = 100105; /* void (CALLBACK*)(GLdouble coords[3], void *data[4], GLfloat weight[4], void **dataOut) */
82 | public const uint GLU_TESS_BEGIN_DATA = 100106; /* void (CALLBACK*)(GLenum type, void *polygon_data) */
83 | public const uint GLU_TESS_VERTEX_DATA = 100107; /* void (CALLBACK*)(void *data, void *polygon_data) */
84 | public const uint GLU_TESS_END_DATA = 100108; /* void (CALLBACK*)(void *polygon_data) */
85 | public const uint GLU_TESS_ERROR_DATA = 100109; /* void (CALLBACK*)(GLenum errno, void *polygon_data) */
86 | public const uint GLU_TESS_EDGE_FLAG_DATA = 100110; /* void (CALLBACK*)(GLboolean boundaryEdge, void *polygon_data) */
87 | public const uint GLU_TESS_COMBINE_DATA = 100111; /* void (CALLBACK*)(GLdouble coords[3], void *data[4], GLfloat weight[4], void **dataOut, void *polygon_data) */
88 |
89 | /* TessError */
90 | public const uint GLU_TESS_ERROR1 = 100151;
91 | public const uint GLU_TESS_ERROR2 = 100152;
92 | public const uint GLU_TESS_ERROR3 = 100153;
93 | public const uint GLU_TESS_ERROR4 = 100154;
94 | public const uint GLU_TESS_ERROR5 = 100155;
95 | public const uint GLU_TESS_ERROR6 = 100156;
96 | public const uint GLU_TESS_ERROR7 = 100157;
97 | public const uint GLU_TESS_ERROR8 = 100158;
98 |
99 | public const uint GLU_TESS_MISSING_BEGIN_POLYGON = GLU_TESS_ERROR1;
100 | public const uint GLU_TESS_MISSING_BEGIN_CONTOUR = GLU_TESS_ERROR2;
101 | public const uint GLU_TESS_MISSING_END_POLYGON = GLU_TESS_ERROR3;
102 | public const uint GLU_TESS_MISSING_END_CONTOUR = GLU_TESS_ERROR4;
103 | public const uint GLU_TESS_COORD_TOO_LARGE = GLU_TESS_ERROR5;
104 | public const uint GLU_TESS_NEED_COMBINE_CALLBACK = GLU_TESS_ERROR6;
105 |
106 | /**** NURBS constants ****/
107 | /* NurbsProperty */
108 | public const uint GLU_AUTO_LOAD_MATRIX = 100200;
109 | public const uint GLU_CULLING = 100201;
110 | public const uint GLU_SAMPLING_TOLERANCE = 100203;
111 | public const uint GLU_DISPLAY_MODE = 100204;
112 | public const uint GLU_PARAMETRIC_TOLERANCE = 100202;
113 | public const uint GLU_SAMPLING_METHOD = 100205;
114 | public const uint GLU_U_STEP = 100206;
115 | public const uint GLU_V_STEP = 100207;
116 |
117 | /* NurbsSampling */
118 | public const uint GLU_PATH_LENGTH = 100215;
119 | public const uint GLU_PARAMETRIC_ERROR = 100216;
120 | public const uint GLU_DOMAIN_DISTANCE = 100217;
121 |
122 | /* NurbsTrim */
123 | public const uint GLU_MAP1_TRIM_2 = 100210;
124 | public const uint GLU_MAP1_TRIM_3 = 100211;
125 |
126 | /* NurbsDisplay */
127 | /* GLU_FILL 100012 */
128 | public const uint GLU_OUTLINE_POLYGON = 100240;
129 | public const uint GLU_OUTLINE_PATCH = 100241;
130 |
131 | /* NurbsCallback */
132 | /* GLU_ERROR 100103 */
133 |
134 | /* NurbsErrors */
135 | public const uint GLU_NURBS_ERROR1 = 100251;
136 | public const uint GLU_NURBS_ERROR2 = 100252;
137 | public const uint GLU_NURBS_ERROR3 = 100253;
138 | public const uint GLU_NURBS_ERROR4 = 100254;
139 | public const uint GLU_NURBS_ERROR5 = 100255;
140 | public const uint GLU_NURBS_ERROR6 = 100256;
141 | public const uint GLU_NURBS_ERROR7 = 100257;
142 | public const uint GLU_NURBS_ERROR8 = 100258;
143 | public const uint GLU_NURBS_ERROR9 = 100259;
144 | public const uint GLU_NURBS_ERROR10 = 100260;
145 | public const uint GLU_NURBS_ERROR11 = 100261;
146 | public const uint GLU_NURBS_ERROR12 = 100262;
147 | public const uint GLU_NURBS_ERROR13 = 100263;
148 | public const uint GLU_NURBS_ERROR14 = 100264;
149 | public const uint GLU_NURBS_ERROR15 = 100265;
150 | public const uint GLU_NURBS_ERROR16 = 100266;
151 | public const uint GLU_NURBS_ERROR17 = 100267;
152 | public const uint GLU_NURBS_ERROR18 = 100268;
153 | public const uint GLU_NURBS_ERROR19 = 100269;
154 | public const uint GLU_NURBS_ERROR20 = 100270;
155 | public const uint GLU_NURBS_ERROR21 = 100271;
156 | public const uint GLU_NURBS_ERROR22 = 100272;
157 | public const uint GLU_NURBS_ERROR23 = 100273;
158 | public const uint GLU_NURBS_ERROR24 = 100274;
159 | public const uint GLU_NURBS_ERROR25 = 100275;
160 | public const uint GLU_NURBS_ERROR26 = 100276;
161 | public const uint GLU_NURBS_ERROR27 = 100277;
162 | public const uint GLU_NURBS_ERROR28 = 100278;
163 | public const uint GLU_NURBS_ERROR29 = 100279;
164 | public const uint GLU_NURBS_ERROR30 = 100280;
165 | public const uint GLU_NURBS_ERROR31 = 100281;
166 | public const uint GLU_NURBS_ERROR32 = 100282;
167 | public const uint GLU_NURBS_ERROR33 = 100283;
168 | public const uint GLU_NURBS_ERROR34 = 100284;
169 | public const uint GLU_NURBS_ERROR35 = 100285;
170 | public const uint GLU_NURBS_ERROR36 = 100286;
171 | public const uint GLU_NURBS_ERROR37 = 100287;
172 |
173 | /* Contours types -- obsolete! */
174 | public const uint GLU_CW = 100120;
175 | public const uint GLU_CCW = 100121;
176 | public const uint GLU_INTERIOR = 100122;
177 | public const uint GLU_EXTERIOR = 100123;
178 | public const uint GLU_UNKNOWN = 100124;
179 |
180 | /* Names without "TESS_" prefix */
181 | public const uint GLU_BEGIN = GLU_TESS_BEGIN;
182 | public const uint GLU_VERTEX = GLU_TESS_VERTEX;
183 | public const uint GLU_END = GLU_TESS_END;
184 | public const uint GLU_ERROR = GLU_TESS_ERROR;
185 | public const uint GLU_EDGE_FLAG = GLU_TESS_EDGE_FLAG;
186 | }
187 | }
188 |
--------------------------------------------------------------------------------
/Source/OpenGL/GLUT.Constants.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : glut.constants.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : OpenGL Utility Toolkit (GLUT) library constants.
6 | // WEB : https://github.com/carmack78/opengldotnet
7 | // AUTHOR : TAYLAN INAN
8 | // E-MAIL : taylaninan@yahoo.com
9 | // DATE : 2014-2018
10 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
11 | // ----------------------------------------------------------------------------
12 |
13 | using System;
14 |
15 | namespace OpenGLDotNet
16 | {
17 | public static partial class GLUT
18 | {
19 | ///////////////////////////////////////////////////////////////////////
20 | // GLUT CONSTANTS
21 | ///////////////////////////////////////////////////////////////////////
22 | public const uint GLUT_API_VERSION = 3;
23 | public const uint GLUT_XLIB_IMPLEMENTATION = 13;
24 |
25 | /* Display mode bit masks. */
26 | public const uint GLUT_RGB = 0;
27 | public const uint GLUT_RGBA = GLUT_RGB;
28 | public const uint GLUT_INDEX = 1;
29 | public const uint GLUT_SINGLE = 0;
30 | public const uint GLUT_DOUBLE = 2;
31 | public const uint GLUT_ACCUM = 4;
32 | public const uint GLUT_ALPHA = 8;
33 | public const uint GLUT_DEPTH = 16;
34 | public const uint GLUT_STENCIL = 32;
35 | public const uint GLUT_MULTISAMPLE = 128;
36 | public const uint GLUT_STEREO = 256;
37 | public const uint GLUT_LUMINANCE = 512;
38 |
39 | /* Mouse buttons. */
40 | public const uint GLUT_LEFT_BUTTON = 0;
41 | public const uint GLUT_MIDDLE_BUTTON = 1;
42 | public const uint GLUT_RIGHT_BUTTON = 2;
43 |
44 | /* Mouse button state. */
45 | public const uint GLUT_DOWN = 0;
46 | public const uint GLUT_UP = 1;
47 |
48 | /* function keys */
49 | public const uint GLUT_KEY_F1 = 1;
50 | public const uint GLUT_KEY_F2 = 2;
51 | public const uint GLUT_KEY_F3 = 3;
52 | public const uint GLUT_KEY_F4 = 4;
53 | public const uint GLUT_KEY_F5 = 5;
54 | public const uint GLUT_KEY_F6 = 6;
55 | public const uint GLUT_KEY_F7 = 7;
56 | public const uint GLUT_KEY_F8 = 8;
57 | public const uint GLUT_KEY_F9 = 9;
58 | public const uint GLUT_KEY_F10 = 10;
59 | public const uint GLUT_KEY_F11 = 11;
60 | public const uint GLUT_KEY_F12 = 12;
61 | /* directional keys */
62 | public const uint GLUT_KEY_LEFT = 100;
63 | public const uint GLUT_KEY_UP = 101;
64 | public const uint GLUT_KEY_RIGHT = 102;
65 | public const uint GLUT_KEY_DOWN = 103;
66 | public const uint GLUT_KEY_PAGE_UP = 104;
67 | public const uint GLUT_KEY_PAGE_DOWN = 105;
68 | public const uint GLUT_KEY_HOME = 106;
69 | public const uint GLUT_KEY_END = 107;
70 | public const uint GLUT_KEY_INSERT = 108;
71 |
72 | /* Entry/exit state. */
73 | public const uint GLUT_LEFT = 0;
74 | public const uint GLUT_ENTERED = 1;
75 |
76 | /* Menu usage state. */
77 | public const uint GLUT_MENU_NOT_IN_USE = 0;
78 | public const uint GLUT_MENU_IN_USE = 1;
79 |
80 | /* Visibility state. */
81 | public const uint GLUT_NOT_VISIBLE = 0;
82 | public const uint GLUT_VISIBLE = 1;
83 |
84 | /* Window status state. */
85 | public const uint GLUT_HIDDEN = 0;
86 | public const uint GLUT_FULLY_RETAINED = 1;
87 | public const uint GLUT_PARTIALLY_RETAINED = 2;
88 | public const uint GLUT_FULLY_COVERED = 3;
89 |
90 | /* Color index component selection values. */
91 | public const uint GLUT_RED = 0;
92 | public const uint GLUT_GREEN = 1;
93 | public const uint GLUT_BLUE = 2;
94 |
95 | /* glutUseLayer parameters. */
96 | public const uint GLUT_NORMAL = 0;
97 | public const uint GLUT_OVERLAY = 1;
98 |
99 | /* Stroke font constants (use these in GLUT program). */
100 | public const uint GLUT_STROKE_ROMAN = 0;
101 | public const uint GLUT_STROKE_MONO_ROMAN = 1;
102 | /* Bitmap font constants (use these in GLUT program). */
103 | public const uint GLUT_BITMAP_9_BY_15 = 2;
104 | public const uint GLUT_BITMAP_8_BY_13 = 3;
105 | public const uint GLUT_BITMAP_TIMES_ROMAN_10 = 4;
106 | public const uint GLUT_BITMAP_TIMES_ROMAN_24 = 5;
107 | public const uint GLUT_BITMAP_HELVETICA_10 = 6;
108 | public const uint GLUT_BITMAP_HELVETICA_12 = 7;
109 | public const uint GLUT_BITMAP_HELVETICA_18 = 8;
110 |
111 | /* glutGet parameters. */
112 | public const uint GLUT_WINDOW_X = 100;
113 | public const uint GLUT_WINDOW_Y = 101;
114 | public const uint GLUT_WINDOW_WIDTH = 102;
115 | public const uint GLUT_WINDOW_HEIGHT = 103;
116 | public const uint GLUT_WINDOW_BUFFER_SIZE = 104;
117 | public const uint GLUT_WINDOW_STENCIL_SIZE = 105;
118 | public const uint GLUT_WINDOW_DEPTH_SIZE = 106;
119 | public const uint GLUT_WINDOW_RED_SIZE = 107;
120 | public const uint GLUT_WINDOW_GREEN_SIZE = 108;
121 | public const uint GLUT_WINDOW_BLUE_SIZE = 109;
122 | public const uint GLUT_WINDOW_ALPHA_SIZE = 110;
123 | public const uint GLUT_WINDOW_ACCUM_RED_SIZE = 111;
124 | public const uint GLUT_WINDOW_ACCUM_GREEN_SIZE = 112;
125 | public const uint GLUT_WINDOW_ACCUM_BLUE_SIZE = 113;
126 | public const uint GLUT_WINDOW_ACCUM_ALPHA_SIZE = 114;
127 | public const uint GLUT_WINDOW_DOUBLEBUFFER = 115;
128 | public const uint GLUT_WINDOW_RGBA = 116;
129 | public const uint GLUT_WINDOW_PARENT = 117;
130 | public const uint GLUT_WINDOW_NUM_CHILDREN = 118;
131 | public const uint GLUT_WINDOW_COLORMAP_SIZE = 119;
132 | public const uint GLUT_WINDOW_NUM_SAMPLES = 120;
133 | public const uint GLUT_WINDOW_STEREO = 121;
134 | public const uint GLUT_WINDOW_CURSOR = 122;
135 | public const uint GLUT_SCREEN_WIDTH = 200;
136 | public const uint GLUT_SCREEN_HEIGHT = 201;
137 | public const uint GLUT_SCREEN_WIDTH_MM = 202;
138 | public const uint GLUT_SCREEN_HEIGHT_MM = 203;
139 | public const uint GLUT_MENU_NUM_ITEMS = 300;
140 | public const uint GLUT_DISPLAY_MODE_POSSIBLE = 400;
141 | public const uint GLUT_INIT_WINDOW_X = 500;
142 | public const uint GLUT_INIT_WINDOW_Y = 501;
143 | public const uint GLUT_INIT_WINDOW_WIDTH = 502;
144 | public const uint GLUT_INIT_WINDOW_HEIGHT = 503;
145 | public const uint GLUT_INIT_DISPLAY_MODE = 504;
146 | public const uint GLUT_ELAPSED_TIME = 700;
147 | public const uint GLUT_WINDOW_FORMAT_ID = 123;
148 |
149 | /* glutDeviceGet parameters. */
150 | public const uint GLUT_HAS_KEYBOARD = 600;
151 | public const uint GLUT_HAS_MOUSE = 601;
152 | public const uint GLUT_HAS_SPACEBALL = 602;
153 | public const uint GLUT_HAS_DIAL_AND_BUTTON_BOX = 603;
154 | public const uint GLUT_HAS_TABLET = 604;
155 | public const uint GLUT_NUM_MOUSE_BUTTONS = 605;
156 | public const uint GLUT_NUM_SPACEBALL_BUTTONS = 606;
157 | public const uint GLUT_NUM_BUTTON_BOX_BUTTONS = 607;
158 | public const uint GLUT_NUM_DIALS = 608;
159 | public const uint GLUT_NUM_TABLET_BUTTONS = 609;
160 | public const uint GLUT_DEVICE_IGNORE_KEY_REPEAT = 610;
161 | public const uint GLUT_DEVICE_KEY_REPEAT = 611;
162 | public const uint GLUT_HAS_JOYSTICK = 612;
163 | public const uint GLUT_OWNS_JOYSTICK = 613;
164 | public const uint GLUT_JOYSTICK_BUTTONS = 614;
165 | public const uint GLUT_JOYSTICK_AXES = 615;
166 | public const uint GLUT_JOYSTICK_POLL_RATE = 616;
167 |
168 | /* glutLayerGet parameters. */
169 | public const uint GLUT_OVERLAY_POSSIBLE = 800;
170 | public const uint GLUT_LAYER_IN_USE = 801;
171 | public const uint GLUT_HAS_OVERLAY = 802;
172 | public const uint GLUT_TRANSPARENT_INDEX = 803;
173 | public const uint GLUT_NORMAL_DAMAGED = 804;
174 | public const uint GLUT_OVERLAY_DAMAGED = 805;
175 |
176 | /* glutVideoResizeGet parameters. */
177 | public const uint GLUT_VIDEO_RESIZE_POSSIBLE = 900;
178 | public const uint GLUT_VIDEO_RESIZE_IN_USE = 901;
179 | public const uint GLUT_VIDEO_RESIZE_X_DELTA = 902;
180 | public const uint GLUT_VIDEO_RESIZE_Y_DELTA = 903;
181 | public const uint GLUT_VIDEO_RESIZE_WIDTH_DELTA = 904;
182 | public const uint GLUT_VIDEO_RESIZE_HEIGHT_DELTA = 905;
183 | public const uint GLUT_VIDEO_RESIZE_X = 906;
184 | public const uint GLUT_VIDEO_RESIZE_Y = 907;
185 | public const uint GLUT_VIDEO_RESIZE_WIDTH = 908;
186 | public const uint GLUT_VIDEO_RESIZE_HEIGHT = 909;
187 |
188 | /* glutGetModifiers return mask. */
189 | public const uint GLUT_ACTIVE_SHIFT = 1;
190 | public const uint GLUT_ACTIVE_CTRL = 2;
191 | public const uint GLUT_ACTIVE_ALT = 4;
192 |
193 | /* glutSetCursor parameters. */
194 | /* Basic arrows. */
195 | public const uint GLUT_CURSOR_RIGHT_ARROW = 0;
196 | public const uint GLUT_CURSOR_LEFT_ARROW = 1;
197 | /* Symbolic cursor shapes. */
198 | public const uint GLUT_CURSOR_INFO = 2;
199 | public const uint GLUT_CURSOR_DESTROY = 3;
200 | public const uint GLUT_CURSOR_HELP = 4;
201 | public const uint GLUT_CURSOR_CYCLE = 5;
202 | public const uint GLUT_CURSOR_SPRAY = 6;
203 | public const uint GLUT_CURSOR_WAIT = 7;
204 | public const uint GLUT_CURSOR_TEXT = 8;
205 | public const uint GLUT_CURSOR_CROSSHAIR = 9;
206 | /* Directional cursors. */
207 | public const uint GLUT_CURSOR_UP_DOWN = 10;
208 | public const uint GLUT_CURSOR_LEFT_RIGHT = 11;
209 | /* Sizing cursors. */
210 | public const uint GLUT_CURSOR_TOP_SIDE = 12;
211 | public const uint GLUT_CURSOR_BOTTOM_SIDE = 13;
212 | public const uint GLUT_CURSOR_LEFT_SIDE = 14;
213 | public const uint GLUT_CURSOR_RIGHT_SIDE = 15;
214 | public const uint GLUT_CURSOR_TOP_LEFT_CORNER = 16;
215 | public const uint GLUT_CURSOR_TOP_RIGHT_CORNER = 17;
216 | public const uint GLUT_CURSOR_BOTTOM_RIGHT_CORNER = 18;
217 | public const uint GLUT_CURSOR_BOTTOM_LEFT_CORNER = 19;
218 | /* Inherit from parent window. */
219 | public const uint GLUT_CURSOR_INHERIT = 100;
220 | /* Blank cursor. */
221 | public const uint GLUT_CURSOR_NONE = 101;
222 | /* Fullscreen crosshair (if available). */
223 | public const uint GLUT_CURSOR_FULL_CROSSHAIR = 102;
224 |
225 | /* GLUT device control sub-API. */
226 | /* glutSetKeyRepeat modes. */
227 | public const uint GLUT_KEY_REPEAT_OFF = 0;
228 | public const uint GLUT_KEY_REPEAT_ON = 1;
229 | public const uint GLUT_KEY_REPEAT_DEFAULT = 2;
230 |
231 | /* Joystick button masks. */
232 | public const uint GLUT_JOYSTICK_BUTTON_A = 1;
233 | public const uint GLUT_JOYSTICK_BUTTON_B = 2;
234 | public const uint GLUT_JOYSTICK_BUTTON_C = 4;
235 | public const uint GLUT_JOYSTICK_BUTTON_D = 8;
236 |
237 | /* GLUT game mode sub-API. */
238 | /* glutGameModeGet. */
239 | public const uint GLUT_GAME_MODE_ACTIVE = 0;
240 | public const uint GLUT_GAME_MODE_POSSIBLE = 1;
241 | public const uint GLUT_GAME_MODE_WIDTH = 2;
242 | public const uint GLUT_GAME_MODE_HEIGHT = 3;
243 | public const uint GLUT_GAME_MODE_PIXEL_DEPTH = 4;
244 | public const uint GLUT_GAME_MODE_REFRESH_RATE = 5;
245 | public const uint GLUT_GAME_MODE_DISPLAY_CHANGED = 6;
246 | }
247 | }
248 |
--------------------------------------------------------------------------------
/Source/OpenGL/WGL.Base.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : wgl.base.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : "Windows" specific OpenGL library loading, extension linking and
6 | // loading shared functions.
7 | // WEB : https://github.com/carmack78/opengldotnet
8 | // AUTHOR : TAYLAN INAN
9 | // E-MAIL : taylaninan@yahoo.com
10 | // DATE : 2014-2018
11 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
12 | // ----------------------------------------------------------------------------
13 |
14 | using System;
15 | using System.Runtime.InteropServices;
16 |
17 | namespace OpenGLDotNet
18 | {
19 | public static partial class WGL
20 | {
21 | ///////////////////////////////////////////////////////////////////////
22 | // VARIABLES
23 | ///////////////////////////////////////////////////////////////////////
24 | private static uint wglLib = 0;
25 | private static uint wglFuncAddr = 0;
26 | private static string wglFuncName = null;
27 | private static string wglLastExtName = null;
28 | private static bool wglDisableExtensions = true;
29 |
30 | ///////////////////////////////////////////////////////////////////////
31 | // INIT
32 | ///////////////////////////////////////////////////////////////////////
33 | public unsafe static void Init(bool DisableExtensionsWhichHaveMissingFunctions = true)
34 | {
35 | wglLib = Windows.LoadLibrary("opengl32.dll");
36 |
37 | if (wglLib == 0)
38 | {
39 | GLConfig.LogWriteLine("[ERROR] 'OPENGL32.DLL' not found!");
40 | }
41 | else
42 | {
43 | wglDisableExtensions = DisableExtensionsWhichHaveMissingFunctions;
44 |
45 | wglFuncAddr = Windows.GetProcAddress(wglLib, "wglGetProcAddress");
46 | wglGetProcAddress = (TwglGetProcAddress)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglGetProcAddress));
47 |
48 | // Link OpenGL Core WGL Functions
49 | WGL.LinkLibWGLCore();
50 |
51 | // Link WGL Extensions
52 | WGL.LinkLibWGLEXT();
53 | }
54 | }
55 |
56 | private static bool LinkProcWGL(string FunctionName)
57 | {
58 | wglFuncName = FunctionName;
59 | wglFuncAddr = Windows.GetProcAddress(wglLib, wglFuncName);
60 |
61 | if (wglFuncAddr == 0 && wglGetProcAddress != null)
62 | {
63 | wglFuncAddr = (uint)wglGetProcAddress(wglFuncName);
64 | }
65 |
66 | if (wglFuncAddr == 0)
67 | {
68 | GLConfig.LogWriteLine("[WARNING] OpenGL function missing: " + wglFuncName);
69 | return false;
70 | }
71 | else
72 | {
73 | return true;
74 | }
75 | }
76 |
77 | private static bool LinkProcWGLEXT(string FunctionName)
78 | {
79 | wglFuncName = FunctionName;
80 | wglFuncAddr = (uint)wglGetProcAddress(wglFuncName);
81 |
82 | if (wglFuncAddr == 0)
83 | {
84 | if (wglDisableExtensions && GLConfig.IsExtensionSupported(wglLastExtName))
85 | {
86 | GLConfig.LogWriteLine("[ INFO ] Disabling Extension : " + wglLastExtName);
87 | GLConfig.DisableExtension(wglLastExtName);
88 | }
89 |
90 | GLConfig.LogWriteLine("[WARNING] Extension function missing: " + wglFuncName);
91 |
92 | return false;
93 | }
94 | else
95 | {
96 | return true;
97 | }
98 | }
99 |
100 | private static bool LinkWGLEXT(string ExtensionName)
101 | {
102 | wglLastExtName = ExtensionName.Trim();
103 |
104 | if (GLConfig.IsExtensionSupported(wglLastExtName))
105 | {
106 | return true;
107 | }
108 | else
109 | {
110 | wglLastExtName = null;
111 | return false;
112 | }
113 | }
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/Source/OpenGL/WGL.CoreConstants.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : wgl.coreconstants.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : "Windows" specific OpenGL Core constants.
6 | // WEB : https://github.com/carmack78/opengldotnet
7 | // AUTHOR : TAYLAN INAN
8 | // E-MAIL : taylaninan@yahoo.com
9 | // DATE : 2014-2018
10 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
11 | // ----------------------------------------------------------------------------
12 |
13 | using System;
14 |
15 | namespace OpenGLDotNet
16 | {
17 | public static partial class WGL
18 | {
19 | ///////////////////////////////////////////////////////////////////////
20 | // OPENGL CORE WGL CONSTANTS
21 | ///////////////////////////////////////////////////////////////////////
22 | // Pixel Types
23 | public const byte PFD_TYPE_RGBA = 0;
24 | public const byte PFD_TYPE_COLORINDEX = 1;
25 |
26 | // PIXELFORMATDESCRIPTOR flags
27 | public const uint PFD_DOUBLEBUFFER = 0x00000001;
28 | public const uint PFD_STEREO = 0x00000002;
29 | public const uint PFD_DRAW_TO_WINDOW = 0x00000004;
30 | public const uint PFD_DRAW_TO_BITMAP = 0x00000008;
31 | public const uint PFD_SUPPORT_GDI = 0x00000010;
32 | public const uint PFD_SUPPORT_OPENGL = 0x00000020;
33 | public const uint PFD_GENERIC_FORMAT = 0x00000040;
34 | public const uint PFD_NEED_PALETTE = 0x00000080;
35 | public const uint PFD_NEED_SYSTEM_PALETTE = 0x00000100;
36 | public const uint PFD_SWAP_EXCHANGE = 0x00000200;
37 | public const uint PFD_SWAP_COPY = 0x00000400;
38 | public const uint PFD_SWAP_LAYER_BUFFERS = 0x00000800;
39 | public const uint PFD_GENERIC_ACCELERATED = 0x00001000;
40 | public const uint PFD_SUPPORT_DIRECTDRAW = 0x00002000;
41 | public const uint PFD_DIRECT3D_ACCELERATED = 0x00004000;
42 | public const uint PFD_SUPPORT_COMPOSITION = 0x00008000;
43 |
44 | // Layer Types
45 | public const sbyte PFD_MAIN_PLANE = 0;
46 | public const sbyte PFD_OVERLAY_PLANE = 1;
47 | public const sbyte PFD_UNDERLAY_PLANE = -1;
48 |
49 | // PIXELFORMATDESCRIPTOR flags for use in ChoosePixelFormat only
50 | public const uint PFD_DEPTH_DONTCARE = 0x20000000;
51 | public const uint PFD_DOUBLEBUFFER_DONTCARE = 0x40000000;
52 | public const uint PFD_STEREO_DONTCARE = 0x80000000;
53 |
54 | // LAYERPLANEDESCRIPTOR
55 | public const uint LPD_TYPE_RGBA = 0;
56 | public const uint LPD_TYPE_COLORINDEX = 1;
57 |
58 | // LAYERPLANEDESCRIPTOR flags
59 | public const uint LPD_DOUBLEBUFFER = 0x00000001;
60 | public const uint LPD_STEREO = 0x00000002;
61 | public const uint LPD_SUPPORT_GDI = 0x00000010;
62 | public const uint LPD_SUPPORT_OPENGL = 0x00000020;
63 | public const uint LPD_SHARE_DEPTH = 0x00000040;
64 | public const uint LPD_SHARE_STENCIL = 0x00000080;
65 | public const uint LPD_SHARE_ACCUM = 0x00000100;
66 | public const uint LPD_SWAP_EXCHANGE = 0x00000200;
67 | public const uint LPD_SWAP_COPY = 0x00000400;
68 | public const uint LPD_TRANSPARENT = 0x00001000;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/Source/OpenGL/WGL.CoreDelegates.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : wgl.coredelegates.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : "Windows" specific OpenGL Core low level delegates and functions.
6 | // WEB : https://github.com/carmack78/opengldotnet
7 | // AUTHOR : TAYLAN INAN
8 | // E-MAIL : taylaninan@yahoo.com
9 | // DATE : 2014-2018
10 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
11 | // ----------------------------------------------------------------------------
12 |
13 | using System;
14 | using System.Runtime.InteropServices;
15 |
16 | using GLboolean = System.Boolean;
17 | using GLenum = System.UInt32;
18 | using GLbitfield = System.UInt32;
19 | using GLintptr = System.Int32;
20 | using GLsizeiptr = System.Int32;
21 | using GLsync = System.UInt32;
22 | using GLhandle = System.UInt32;
23 | using GLhalf = System.UInt16;
24 | using GLvdpauSurface = System.Int32;
25 | using GLfixed = System.Int32;
26 |
27 | using GLchar = System.Byte; // 1 byte
28 | using GLbyte = System.SByte; // 1 byte
29 | using GLubyte = System.Byte; // 1 byte
30 | using GLshort = System.Int16; // 2 bytes
31 | using GLushort = System.UInt16; // 2 bytes
32 | using GLsizei = System.Int32; // 4 bytes
33 | using GLint = System.Int32; // 4 bytes
34 | using GLuint = System.UInt32; // 4 bytes
35 | using GLint64 = System.Int64; // 8 bytes
36 | using GLuint64 = System.UInt64; // 8 bytes
37 | using GLclampf = System.Single; // single precision float in [0,1]
38 | using GLclampd = System.Double; // double precision float in [0,1]
39 | using GLfloat = System.Single; // 4 bytes
40 | using GLdouble = System.Double; // 8 bytes
41 |
42 | namespace OpenGLDotNet
43 | {
44 | public static partial class WGL
45 | {
46 | ///////////////////////////////////////////////////////////////////////
47 | // OPENGL CORE WGL FUNCTIONS
48 | ///////////////////////////////////////////////////////////////////////
49 | #region OPENGL CORE WGL FUNCTIONS...
50 | // int WINAPI wglChoosePixelFormat( HDC hdc, const PIXELFORMATDESCRIPTOR *ppfd);
51 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
52 | [System.Security.SuppressUnmanagedCodeSecurity()]
53 | private delegate int TwglChoosePixelFormat(IntPtr hDC, ref PIXELFORMATDESCRIPTOR ppfd);
54 | private static TwglChoosePixelFormat wglChoosePixelFormat = null;
55 |
56 | // int WINAPI wglDescribePixelFormat( HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd);
57 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
58 | [System.Security.SuppressUnmanagedCodeSecurity()]
59 | private delegate int TwglDescribePixelFormat(IntPtr hDC, int iPixelFormat, uint nBytes, ref PIXELFORMATDESCRIPTOR ppfd);
60 | private static TwglDescribePixelFormat wglDescribePixelFormat = null;
61 |
62 | // int WINAPI wglGetPixelFormat( HDC hdc );
63 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
64 | [System.Security.SuppressUnmanagedCodeSecurity()]
65 | private delegate int TwglGetPixelFormat(IntPtr hdc);
66 | private static TwglGetPixelFormat wglGetPixelFormat = null;
67 |
68 | // BOOL WINAPI wglSetPixelFormat( HDC hdc, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd);
69 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
70 | [System.Security.SuppressUnmanagedCodeSecurity()]
71 | private delegate bool TwglSetPixelFormat(IntPtr hdc, int iPixelFormat, ref PIXELFORMATDESCRIPTOR ppfd);
72 | private static TwglSetPixelFormat wglSetPixelFormat = null;
73 |
74 | // BOOL WINAPI wglSwapBuffers( HDC hdc );
75 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
76 | [System.Security.SuppressUnmanagedCodeSecurity()]
77 | private delegate bool TwglSwapBuffers(IntPtr hdc);
78 | private static TwglSwapBuffers wglSwapBuffers = null;
79 |
80 | // HGLRC WINAPI wglCreateContext( HDC hdc );
81 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
82 | [System.Security.SuppressUnmanagedCodeSecurity()]
83 | private delegate IntPtr TwglCreateContext(IntPtr hdc);
84 | private static TwglCreateContext wglCreateContext = null;
85 |
86 | // HGLRC WINAPI wglCreateLayerContext( HDC hdc, int iLayerPlane );
87 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
88 | [System.Security.SuppressUnmanagedCodeSecurity()]
89 | private delegate IntPtr TwglCreateLayerContext(IntPtr hdc, int iLayerPlane);
90 | private static TwglCreateLayerContext wglCreateLayerContext = null;
91 |
92 | // BOOL WINAPI wglCopyContext( HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask );
93 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
94 | [System.Security.SuppressUnmanagedCodeSecurity()]
95 | private delegate bool TwglCopyContext(IntPtr hglrcSrc, IntPtr hglrcDst, uint mask);
96 | private static TwglCopyContext wglCopyContext = null;
97 |
98 | // BOOL WINAPI wglDeleteContext( HGLRC hglrc );
99 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
100 | [System.Security.SuppressUnmanagedCodeSecurity()]
101 | private delegate bool TwglDeleteContext(IntPtr hglrc);
102 | private static TwglDeleteContext wglDeleteContext = null;
103 |
104 | // BOOL WINAPI wglDescribeLayerPlane( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nBytes, LPLAYERPLANEDESCRIPTOR plpd );
105 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
106 | [System.Security.SuppressUnmanagedCodeSecurity()]
107 | private delegate bool TwglDescribeLayerPlane(IntPtr hDC, int iPixelFormat, int iLayerPlane, uint nBytes, ref LAYERPLANEDESCRIPTOR plpd);
108 | private static TwglDescribeLayerPlane wglDescribeLayerPlane = null;
109 |
110 | // HGLRC WINAPI wglGetCurrentContext(void);
111 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
112 | [System.Security.SuppressUnmanagedCodeSecurity()]
113 | private delegate IntPtr TwglGetCurrentContext();
114 | private static TwglGetCurrentContext wglGetCurrentContext = null;
115 |
116 | // HDC WINAPI wglGetCurrentDC(void);
117 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
118 | [System.Security.SuppressUnmanagedCodeSecurity()]
119 | private delegate IntPtr TwglGetCurrentDC();
120 | private static TwglGetCurrentDC wglGetCurrentDC = null;
121 |
122 | // int WINAPI wglGetLayerPaletteEntries( HDC hdc, int iLayerPlane, int iStart, int cEntries, COLORREF *pcr);
123 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
124 | [System.Security.SuppressUnmanagedCodeSecurity()]
125 | private delegate int TwglGetLayerPaletteEntries(IntPtr hDC, int iLayerPlane, int iStart, int cEntries, ref COLORREF pcr);
126 | private static TwglGetLayerPaletteEntries wglGetLayerPaletteEntries = null;
127 |
128 | // PROC WINAPI wglGetProcAddress( LPCSTR lpszProc );
129 | [UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet = CharSet.Ansi)]
130 | [System.Security.SuppressUnmanagedCodeSecurity()]
131 | private delegate IntPtr TwglGetProcAddress(string procname);
132 | private static TwglGetProcAddress wglGetProcAddress = null;
133 |
134 | // BOOL WINAPI wglMakeCurrent( HDC hdc, HGLRC hglrc);
135 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
136 | [System.Security.SuppressUnmanagedCodeSecurity()]
137 | private delegate bool TwglMakeCurrent(IntPtr hdc, IntPtr hglrc);
138 | private static TwglMakeCurrent wglMakeCurrent = null;
139 |
140 | // BOOL WINAPI wglRealizeLayerPalette( HDC hdc, int iLayerPlane, BOOL bRealize );
141 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
142 | [System.Security.SuppressUnmanagedCodeSecurity()]
143 | private delegate bool TwglRealizeLayerPalette(IntPtr hdc, int iLayerPlane, bool bRealize);
144 | private static TwglRealizeLayerPalette wglRealizeLayerPalette = null;
145 |
146 | // int WINAPI wglSetLayerPaletteEntries( HDC hdc, int iLayerPlane, int iStart, int cEntries, const COLORREF *pcr );
147 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
148 | [System.Security.SuppressUnmanagedCodeSecurity()]
149 | private delegate int TwglSetLayerPaletteEntries(IntPtr hDC, int iLayerPlane, int iStart, int cEntries, ref COLORREF pcr);
150 | private static TwglSetLayerPaletteEntries wglSetLayerPaletteEntries = null;
151 |
152 | // BOOL WINAPI wglShareLists( HGLRC hglrc1, HGLRC hglrc2);
153 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
154 | [System.Security.SuppressUnmanagedCodeSecurity()]
155 | private delegate bool TwglShareLists(IntPtr hglrc1, IntPtr hglrc2);
156 | private static TwglShareLists wglShareLists = null;
157 |
158 | // BOOL WINAPI wglSwapLayerBuffers( HDC hdc, UINT fuPlanes);
159 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
160 | [System.Security.SuppressUnmanagedCodeSecurity()]
161 | private delegate bool TwglSwapLayerBuffers(IntPtr hdc, uint fuPlanes);
162 | private static TwglSwapLayerBuffers wglSwapLayerBuffers = null;
163 |
164 | // BOOL WINAPI wglUseFontBitmaps( HDC hdc, DWORD first, DWORD count, DWORD listBase );
165 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
166 | [System.Security.SuppressUnmanagedCodeSecurity()]
167 | private delegate bool TwglUseFontBitmaps(IntPtr hdc, uint first, uint count, uint listBase);
168 | private static TwglUseFontBitmaps wglUseFontBitmaps = null;
169 |
170 | // BOOL WINAPI wglUseFontOutlines( HDC hdc, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf);
171 | [UnmanagedFunctionPointer(CallingConvention.StdCall)]
172 | [System.Security.SuppressUnmanagedCodeSecurity()]
173 | private delegate bool TwglUseFontOutlines(IntPtr hDC, uint first, uint count, uint listBase, float deviation, float extrusion, int format, ref GLYPHMETRICSFLOAT lpgmf);
174 | private static TwglUseFontOutlines wglUseFontOutlines = null;
175 |
176 | #endregion
177 | }
178 | }
179 |
--------------------------------------------------------------------------------
/Source/OpenGL/WGL.CoreLinker.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : wgl.coredelegates.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : "Windows" specific OpenGL Core low level functions dynamic linker.
6 | // WEB : https://github.com/carmack78/opengldotnet
7 | // AUTHOR : TAYLAN INAN
8 | // E-MAIL : taylaninan@yahoo.com
9 | // DATE : 2014-2018
10 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
11 | // ----------------------------------------------------------------------------
12 |
13 | using System;
14 | using System.Runtime.InteropServices;
15 |
16 | namespace OpenGLDotNet
17 | {
18 | public static partial class WGL
19 | {
20 | private static void LinkLibWGLCore()
21 | {
22 | ///////////////////////////////////////////////////////////////////
23 | // OPENGL WGL FUNCTIONS
24 | ///////////////////////////////////////////////////////////////////
25 |
26 | GLConfig.LogWriteLine();
27 | GLConfig.LogWriteLine("Linking OpenGL Core WGL functions...");
28 | GLConfig.LogWriteLine("============================================================");
29 |
30 | #region LINKING OPENGL CORE WGL FUNCTIONS...
31 | if (LinkProcWGL("wglChoosePixelFormat"))
32 | {
33 | wglChoosePixelFormat = (TwglChoosePixelFormat)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglChoosePixelFormat));
34 | }
35 |
36 | if (LinkProcWGL("wglDescribePixelFormat"))
37 | {
38 | wglDescribePixelFormat = (TwglDescribePixelFormat)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglDescribePixelFormat));
39 | }
40 |
41 | if (LinkProcWGL("wglGetPixelFormat"))
42 | {
43 | wglGetPixelFormat = (TwglGetPixelFormat)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglGetPixelFormat));
44 | }
45 |
46 | if (LinkProcWGL("wglSetPixelFormat"))
47 | {
48 | wglSetPixelFormat = (TwglSetPixelFormat)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglSetPixelFormat));
49 | }
50 |
51 | if (LinkProcWGL("wglSwapBuffers"))
52 | {
53 | wglSwapBuffers = (TwglSwapBuffers)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglSwapBuffers));
54 | }
55 |
56 | if (LinkProcWGL("wglCreateContext"))
57 | {
58 | wglCreateContext = (TwglCreateContext)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglCreateContext));
59 | }
60 |
61 | if (LinkProcWGL("wglCreateLayerContext"))
62 | {
63 | wglCreateLayerContext = (TwglCreateLayerContext)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglCreateLayerContext));
64 | }
65 |
66 | if (LinkProcWGL("wglCopyContext"))
67 | {
68 | wglCopyContext = (TwglCopyContext)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglCopyContext));
69 | }
70 |
71 | if (LinkProcWGL("wglDeleteContext"))
72 | {
73 | wglDeleteContext = (TwglDeleteContext)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglDeleteContext));
74 | }
75 |
76 | if (LinkProcWGL("wglDescribeLayerPlane"))
77 | {
78 | wglDescribeLayerPlane = (TwglDescribeLayerPlane)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglDescribeLayerPlane));
79 | }
80 |
81 | if (LinkProcWGL("wglGetCurrentContext"))
82 | {
83 | wglGetCurrentContext = (TwglGetCurrentContext)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglGetCurrentContext));
84 | }
85 |
86 | if (LinkProcWGL("wglGetCurrentDC"))
87 | {
88 | wglGetCurrentDC = (TwglGetCurrentDC)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglGetCurrentDC));
89 | }
90 |
91 | if (LinkProcWGL("wglGetLayerPaletteEntries"))
92 | {
93 | wglGetLayerPaletteEntries = (TwglGetLayerPaletteEntries)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglGetLayerPaletteEntries));
94 | }
95 |
96 | if (LinkProcWGL("wglGetProcAddress"))
97 | {
98 | wglGetProcAddress = (TwglGetProcAddress)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglGetProcAddress));
99 | }
100 |
101 | if (LinkProcWGL("wglMakeCurrent"))
102 | {
103 | wglMakeCurrent = (TwglMakeCurrent)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglMakeCurrent));
104 | }
105 |
106 | if (LinkProcWGL("wglRealizeLayerPalette"))
107 | {
108 | wglRealizeLayerPalette = (TwglRealizeLayerPalette)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglRealizeLayerPalette));
109 | }
110 |
111 | if (LinkProcWGL("wglSetLayerPaletteEntries"))
112 | {
113 | wglSetLayerPaletteEntries = (TwglSetLayerPaletteEntries)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglSetLayerPaletteEntries));
114 | }
115 |
116 | if (LinkProcWGL("wglShareLists"))
117 | {
118 | wglShareLists = (TwglShareLists)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglShareLists));
119 | }
120 |
121 | if (LinkProcWGL("wglSwapLayerBuffers"))
122 | {
123 | wglSwapLayerBuffers = (TwglSwapLayerBuffers)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglSwapLayerBuffers));
124 | }
125 |
126 | if (LinkProcWGL("wglUseFontBitmapsW"))
127 | {
128 | wglUseFontBitmaps = (TwglUseFontBitmaps)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglUseFontBitmaps));
129 | }
130 |
131 | if (LinkProcWGL("wglUseFontOutlinesW"))
132 | {
133 | wglUseFontOutlines = (TwglUseFontOutlines)Marshal.GetDelegateForFunctionPointer((IntPtr)wglFuncAddr, typeof(TwglUseFontOutlines));
134 | }
135 | #endregion
136 | }
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/Source/OpenGL/WGL.CoreTypes.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : wgl.coretypes.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : "Windows" specific OpenGL Core types.
6 | // WEB : https://github.com/carmack78/opengldotnet
7 | // AUTHOR : TAYLAN INAN
8 | // E-MAIL : taylaninan@yahoo.com
9 | // DATE : 2014-2018
10 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
11 | // ----------------------------------------------------------------------------
12 |
13 | using System;
14 | using System.Runtime.InteropServices;
15 |
16 | namespace OpenGLDotNet
17 | {
18 | public static partial class WGL
19 | {
20 | ///////////////////////////////////////////////////////////////////////
21 | // OPENGL CORE WGL TYPES
22 | ///////////////////////////////////////////////////////////////////////
23 | [StructLayout(LayoutKind.Explicit)]
24 | public struct PIXELFORMATDESCRIPTOR
25 | {
26 | [FieldOffset(00)] public UInt16 nSize;
27 | [FieldOffset(02)] public UInt16 nVersion;
28 | [FieldOffset(04)] public UInt32 dwFlags;
29 | [FieldOffset(08)] public Byte iPixelType;
30 | [FieldOffset(09)] public Byte cColorBits;
31 | [FieldOffset(10)] public Byte cRedBits;
32 | [FieldOffset(11)] public Byte cRedShift;
33 | [FieldOffset(12)] public Byte cGreenBits;
34 | [FieldOffset(13)] public Byte cGreenShift;
35 | [FieldOffset(14)] public Byte cBlueBits;
36 | [FieldOffset(15)] public Byte cBlueShift;
37 | [FieldOffset(16)] public Byte cAlphaBits;
38 | [FieldOffset(17)] public Byte cAlphaShift;
39 | [FieldOffset(18)] public Byte cAccumBits;
40 | [FieldOffset(19)] public Byte cAccumRedBits;
41 | [FieldOffset(20)] public Byte cAccumGreenBits;
42 | [FieldOffset(21)] public Byte cAccumBlueBits;
43 | [FieldOffset(22)] public Byte cAccumAlphaBits;
44 | [FieldOffset(23)] public Byte cDepthBits;
45 | [FieldOffset(24)] public Byte cStencilBits;
46 | [FieldOffset(25)] public Byte cAuxBuffers;
47 | [FieldOffset(26)] public Byte iLayerType;
48 | [FieldOffset(27)] public Byte bReserved;
49 | [FieldOffset(28)] public UInt32 dwLayerMask;
50 | [FieldOffset(32)] public UInt32 dwVisibleMask;
51 | [FieldOffset(36)] public UInt32 dwDamageMask;
52 | }
53 |
54 | [StructLayout(LayoutKind.Explicit)]
55 | public struct POINTFLOAT
56 | {
57 | [FieldOffset(00)] public Single x;
58 | [FieldOffset(04)] public Single y;
59 | }
60 |
61 | [StructLayout(LayoutKind.Explicit)]
62 | public struct GLYPHMETRICSFLOAT
63 | {
64 | [FieldOffset(00)] public Single gmfBlackBoxX;
65 | [FieldOffset(04)] public Single gmfBlackBoxY;
66 | [FieldOffset(08)] public POINTFLOAT gmfptGlyphOrigin;
67 | [FieldOffset(16)] public Single gmfCellIncX;
68 | [FieldOffset(20)] public Single gmfCellIncY;
69 | }
70 |
71 | [StructLayout(LayoutKind.Explicit)]
72 | public struct COLORREF
73 | {
74 | [FieldOffset(00)] public UInt32 Value;
75 | [FieldOffset(00)] public Byte R;
76 | [FieldOffset(01)] public Byte G;
77 | [FieldOffset(02)] public Byte B;
78 | [FieldOffset(03)] public Byte A;
79 | }
80 |
81 | [StructLayout(LayoutKind.Explicit)]
82 | public struct LAYERPLANEDESCRIPTOR
83 | {
84 | [FieldOffset(00)] public UInt16 nSize;
85 | [FieldOffset(02)] public UInt16 nVersion;
86 | [FieldOffset(04)] public UInt32 dwFlags;
87 | [FieldOffset(08)] public Byte iPixelType;
88 | [FieldOffset(09)] public Byte cColorBits;
89 | [FieldOffset(10)] public Byte cRedBits;
90 | [FieldOffset(11)] public Byte cRedShift;
91 | [FieldOffset(12)] public Byte cGreenBits;
92 | [FieldOffset(13)] public Byte cGreenShift;
93 | [FieldOffset(14)] public Byte cBlueBits;
94 | [FieldOffset(15)] public Byte cBlueShift;
95 | [FieldOffset(16)] public Byte cAlphaBits;
96 | [FieldOffset(17)] public Byte cAlphaShift;
97 | [FieldOffset(18)] public Byte cAccumBits;
98 | [FieldOffset(19)] public Byte cAccumRedBits;
99 | [FieldOffset(20)] public Byte cAccumGreenBits;
100 | [FieldOffset(21)] public Byte cAccumBlueBits;
101 | [FieldOffset(22)] public Byte cAccumAlphaBits;
102 | [FieldOffset(23)] public Byte cDepthBits;
103 | [FieldOffset(24)] public Byte cStencilBits;
104 | [FieldOffset(25)] public Byte cAuxBuffer;
105 | [FieldOffset(26)] public Byte iLayerType;
106 | [FieldOffset(27)] public Byte bReserved;
107 | [FieldOffset(28)] public COLORREF crTransparent;
108 | }
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/Source/OpenGL/WGL.CoreWrappers.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : wgl.corewrappers.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : "Windows" specific OpenGL Core low level function wrappers.
6 | // WEB : https://github.com/carmack78/opengldotnet
7 | // AUTHOR : TAYLAN INAN
8 | // E-MAIL : taylaninan@yahoo.com
9 | // DATE : 2014-2018
10 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
11 | // ----------------------------------------------------------------------------
12 |
13 | using System;
14 | using System.Runtime.InteropServices;
15 |
16 | using GLboolean = System.Boolean;
17 | using GLenum = System.UInt32;
18 | using GLbitfield = System.UInt32;
19 | using GLintptr = System.Int32;
20 | using GLsizeiptr = System.Int32;
21 | using GLsync = System.UInt32;
22 | using GLhandle = System.UInt32;
23 | using GLhalf = System.UInt16;
24 | using GLvdpauSurface = System.Int32;
25 | using GLfixed = System.Int32;
26 |
27 | using GLchar = System.Byte; // 1 byte
28 | using GLbyte = System.SByte; // 1 byte
29 | using GLubyte = System.Byte; // 1 byte
30 | using GLshort = System.Int16; // 2 bytes
31 | using GLushort = System.UInt16; // 2 bytes
32 | using GLsizei = System.Int32; // 4 bytes
33 | using GLint = System.Int32; // 4 bytes
34 | using GLuint = System.UInt32; // 4 bytes
35 | using GLint64 = System.Int64; // 8 bytes
36 | using GLuint64 = System.UInt64; // 8 bytes
37 | using GLclampf = System.Single; // single precision float in [0,1]
38 | using GLclampd = System.Double; // double precision float in [0,1]
39 | using GLfloat = System.Single; // 4 bytes
40 | using GLdouble = System.Double; // 8 bytes
41 |
42 | namespace OpenGLDotNet
43 | {
44 | public static partial class WGL
45 | {
46 | ///////////////////////////////////////////////////////////////////////
47 | // OPENGL WGL WRAPPERS
48 | ///////////////////////////////////////////////////////////////////////
49 | #region OPENGL WGL WRAPPERS...
50 | // int WINAPI wglChoosePixelFormat( HDC hdc, const PIXELFORMATDESCRIPTOR *ppfd);
51 | public static int ChoosePixelFormat(IntPtr hDC, ref PIXELFORMATDESCRIPTOR ppfd)
52 | {
53 | if (wglChoosePixelFormat != null)
54 | {
55 | return wglChoosePixelFormat(hDC, ref ppfd);
56 | }
57 | else
58 | {
59 | return 0;
60 | }
61 | }
62 |
63 | // int WINAPI wglDescribePixelFormat( HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd);
64 | public static int DescribePixelFormat(IntPtr hDC, int iPixelFormat, uint nBytes, ref PIXELFORMATDESCRIPTOR ppfd)
65 | {
66 | if (wglDescribePixelFormat != null)
67 | {
68 | return wglDescribePixelFormat(hDC, iPixelFormat, nBytes, ref ppfd);
69 | }
70 | else
71 | {
72 | return 0;
73 | }
74 | }
75 |
76 | // int WINAPI wglGetPixelFormat( HDC hdc );
77 | public static int GetPixelFormat(IntPtr hdc)
78 | {
79 | if (wglGetPixelFormat != null)
80 | {
81 | return wglGetPixelFormat(hdc);
82 | }
83 | else
84 | {
85 | return 0;
86 | }
87 | }
88 |
89 | // BOOL WINAPI wglSetPixelFormat( HDC hdc, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd);
90 | public static bool SetPixelFormat(IntPtr hdc, int iPixelFormat, ref PIXELFORMATDESCRIPTOR ppfd)
91 | {
92 | if (wglSetPixelFormat != null)
93 | {
94 | return wglSetPixelFormat(hdc, iPixelFormat, ref ppfd);
95 | }
96 | else
97 | {
98 | return false;
99 | }
100 | }
101 |
102 | // BOOL WINAPI wglSwapBuffers( HDC hdc );
103 | public static bool SwapBuffers(IntPtr hdc)
104 | {
105 | if (wglSwapBuffers != null)
106 | {
107 | return wglSwapBuffers(hdc);
108 | }
109 | else
110 | {
111 | return false;
112 | }
113 | }
114 |
115 | // HGLRC WINAPI wglCreateContext( HDC hdc );
116 | public static IntPtr CreateContext(IntPtr hdc)
117 | {
118 | if (wglCreateContext != null)
119 | {
120 | return wglCreateContext(hdc);
121 | }
122 | else
123 | {
124 | return IntPtr.Zero;
125 | }
126 | }
127 |
128 | // HGLRC WINAPI wglCreateLayerContext( HDC hdc, int iLayerPlane );
129 | public static IntPtr CreateLayerContext(IntPtr hdc, int iLayerPlane)
130 | {
131 | if (wglCreateLayerContext != null)
132 | {
133 | return wglCreateLayerContext(hdc, iLayerPlane);
134 | }
135 | else
136 | {
137 | return IntPtr.Zero;
138 | }
139 | }
140 |
141 | // BOOL WINAPI wglCopyContext( HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask );
142 | public static bool CopyContext(IntPtr hglrcSrc, IntPtr hglrcDst, uint mask)
143 | {
144 | if (wglCopyContext != null)
145 | {
146 | return wglCopyContext(hglrcSrc, hglrcDst, mask);
147 | }
148 | else
149 | {
150 | return false;
151 | }
152 | }
153 |
154 | // BOOL WINAPI wglDeleteContext( HGLRC hglrc );
155 | public static bool DeleteContext(IntPtr hglrc)
156 | {
157 | if (wglDeleteContext != null)
158 | {
159 | return wglDeleteContext(hglrc);
160 | }
161 | else
162 | {
163 | return false;
164 | }
165 | }
166 |
167 | // BOOL WINAPI wglDescribeLayerPlane( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nBytes, LPLAYERPLANEDESCRIPTOR plpd );
168 | public static bool DescribeLayerPlane(IntPtr hDC, int iPixelFormat, int iLayerPlane, uint nBytes, LAYERPLANEDESCRIPTOR plpd)
169 | {
170 | if (wglDescribeLayerPlane != null)
171 | {
172 | return wglDescribeLayerPlane(hDC, iPixelFormat, iLayerPlane, nBytes, ref plpd);
173 | }
174 | else
175 | {
176 | return false;
177 | }
178 | }
179 |
180 | // HGLRC WINAPI wglGetCurrentContext(void);
181 | public static IntPtr GetCurrentContext()
182 | {
183 | if (wglGetCurrentContext != null)
184 | {
185 | return wglGetCurrentContext();
186 | }
187 | else
188 | {
189 | return IntPtr.Zero;
190 | }
191 | }
192 |
193 | // HDC WINAPI wglGetCurrentDC(void);
194 | public static IntPtr GetCurrentDC()
195 | {
196 | if (wglGetCurrentDC != null)
197 | {
198 | return wglGetCurrentDC();
199 | }
200 | else
201 | {
202 | return IntPtr.Zero;
203 | }
204 | }
205 |
206 | // int WINAPI wglGetLayerPaletteEntries( HDC hdc, int iLayerPlane, int iStart, int cEntries, COLORREF *pcr);
207 | public static int GetLayerPaletteEntries(IntPtr hDC, int iLayerPlane, int iStart, int cEntries, ref COLORREF pcr)
208 | {
209 | if (wglGetLayerPaletteEntries != null)
210 | {
211 | return wglGetLayerPaletteEntries(hDC, iLayerPlane, iStart, cEntries, ref pcr);
212 | }
213 | else
214 | {
215 | return 0;
216 | }
217 | }
218 |
219 | // PROC WINAPI wglGetProcAddress( LPCSTR lpszProc );
220 | public static IntPtr GetProcAddress(string procname)
221 | {
222 | if (wglGetProcAddress != null)
223 | {
224 | return wglGetProcAddress(procname);
225 | }
226 | else
227 | {
228 | return IntPtr.Zero;
229 | }
230 | }
231 |
232 | // BOOL WINAPI wglMakeCurrent( HDC hdc, HGLRC hglrc);
233 | public static bool MakeCurrent(IntPtr hdc, IntPtr hglrc)
234 | {
235 | if (wglMakeCurrent != null)
236 | {
237 | return wglMakeCurrent(hdc, hglrc);
238 | }
239 | else
240 | {
241 | return false;
242 | }
243 | }
244 |
245 | // BOOL WINAPI wglRealizeLayerPalette( HDC hdc, int iLayerPlane, BOOL bRealize );
246 | public static bool RealizeLayerPalette(IntPtr hdc, int iLayerPlane, bool bRealize)
247 | {
248 | if (wglRealizeLayerPalette != null)
249 | {
250 | return wglRealizeLayerPalette(hdc, iLayerPlane, bRealize);
251 | }
252 | else
253 | {
254 | return false;
255 | }
256 | }
257 |
258 | // int WINAPI wglSetLayerPaletteEntries( HDC hdc, int iLayerPlane, int iStart, int cEntries, const COLORREF *pcr );
259 | public static int SetLayerPaletteEntries(IntPtr hDC, int iLayerPlane, int iStart, int cEntries, ref COLORREF pcr)
260 | {
261 | if (wglSetLayerPaletteEntries != null)
262 | {
263 | return wglSetLayerPaletteEntries(hDC, iLayerPlane, iStart, cEntries, ref pcr);
264 | }
265 | else
266 | {
267 | return 0;
268 | }
269 | }
270 |
271 | // BOOL WINAPI wglShareLists( HGLRC hglrc1, HGLRC hglrc2);
272 | public static bool ShareLists(IntPtr hglrc1, IntPtr hglrc2)
273 | {
274 | if (wglShareLists != null)
275 | {
276 | return wglShareLists(hglrc1, hglrc2);
277 | }
278 | else
279 | {
280 | return false;
281 | }
282 | }
283 |
284 | // BOOL WINAPI wglSwapLayerBuffers( HDC hdc, UINT fuPlanes);
285 | public static bool SwapLayerBuffers(IntPtr hdc, uint fuPlanes)
286 | {
287 | if (wglSwapLayerBuffers != null)
288 | {
289 | return wglSwapLayerBuffers(hdc, fuPlanes);
290 | }
291 | else
292 | {
293 | return false;
294 | }
295 | }
296 |
297 | // BOOL WINAPI wglUseFontBitmaps( HDC hdc, DWORD first, DWORD count, DWORD listBase );
298 | public static bool UseFontBitmaps(IntPtr hdc, uint first, uint count, uint listBase)
299 | {
300 | if (wglUseFontBitmaps != null)
301 | {
302 | return wglUseFontBitmaps(hdc, first, count, listBase);
303 | }
304 | else
305 | {
306 | return false;
307 | }
308 | }
309 |
310 | // BOOL WINAPI wglUseFontOutlines( HDC hdc, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf);
311 | public static bool UseFontOutlines(IntPtr hDC, uint first, uint count, uint listBase, float deviation, float extrusion, int format, ref GLYPHMETRICSFLOAT lpgmf)
312 | {
313 | if (wglUseFontOutlines != null)
314 | {
315 | return wglUseFontOutlines(hDC, first, count, listBase, deviation, extrusion, format, ref lpgmf);
316 | }
317 | else
318 | {
319 | return false;
320 | }
321 | }
322 | #endregion
323 | }
324 | }
--------------------------------------------------------------------------------
/Source/Platform/Windows.cs:
--------------------------------------------------------------------------------
1 | // ----------------------------------------------------------------------------
2 | // FILE : windows.cs
3 | // VERSION : 1.1.3
4 | // DATE : 26 April 2018
5 | // COMMENT : Defines and imports "Windows" specific Library (*.dll) functionality
6 | // from kernel32.dll.
7 | // WEB : https://github.com/carmack78/opengldotnet
8 | // AUTHOR : TAYLAN INAN
9 | // E-MAIL : taylaninan@yahoo.com
10 | // DATE : 2014-2018
11 | // LICENSE : FREE FOR EDUCATIONAL, PERSONAL AND COMMERCIAL USAGE
12 | // ----------------------------------------------------------------------------
13 |
14 | using System;
15 | using System.Runtime.InteropServices;
16 |
17 | namespace OpenGLDotNet
18 | {
19 | public static class Windows
20 | {
21 | private const string LIBKERNEL = "kernel32.dll";
22 |
23 | ///////////////////////////////////////////////////////////////////////
24 | // FUNCTIONS
25 | ///////////////////////////////////////////////////////////////////////
26 | [DllImport(LIBKERNEL, CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode, EntryPoint = "LoadLibraryW")]
27 | [System.Security.SuppressUnmanagedCodeSecurity()]
28 | public static extern uint LoadLibrary(string LibraryName);
29 |
30 | [DllImport(LIBKERNEL, CallingConvention = CallingConvention.StdCall)]
31 | [System.Security.SuppressUnmanagedCodeSecurity()]
32 | public static extern bool FreeLibrary(uint LibraryHandle);
33 |
34 | [DllImport(LIBKERNEL, CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
35 | [System.Security.SuppressUnmanagedCodeSecurity()]
36 | public static extern uint GetProcAddress(uint LibraryHandle, string ProcedureName);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Source/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/bin/Debug/DevIL.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/DevIL.dll
--------------------------------------------------------------------------------
/bin/Debug/ILU.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/ILU.dll
--------------------------------------------------------------------------------
/bin/Debug/ILUT.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/ILUT.dll
--------------------------------------------------------------------------------
/bin/Debug/NAudio.WindowsMediaFormat.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/NAudio.WindowsMediaFormat.dll
--------------------------------------------------------------------------------
/bin/Debug/NAudio.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/NAudio.dll
--------------------------------------------------------------------------------
/bin/Debug/data/cm_back.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/data/cm_back.jpg
--------------------------------------------------------------------------------
/bin/Debug/data/cm_xneg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/data/cm_xneg.jpg
--------------------------------------------------------------------------------
/bin/Debug/data/cm_xpos.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/data/cm_xpos.jpg
--------------------------------------------------------------------------------
/bin/Debug/data/cm_yneg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/data/cm_yneg.jpg
--------------------------------------------------------------------------------
/bin/Debug/data/cm_ypos.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/data/cm_ypos.jpg
--------------------------------------------------------------------------------
/bin/Debug/data/cm_zneg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/data/cm_zneg.jpg
--------------------------------------------------------------------------------
/bin/Debug/data/cm_zpos.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/data/cm_zpos.jpg
--------------------------------------------------------------------------------
/bin/Debug/data/colormap.pcx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/data/colormap.pcx
--------------------------------------------------------------------------------
/bin/Debug/data/conback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/data/conback.png
--------------------------------------------------------------------------------
/bin/Debug/data/conback2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/data/conback2.jpg
--------------------------------------------------------------------------------
/bin/Debug/data/conchars.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/data/conchars.png
--------------------------------------------------------------------------------
/bin/Debug/freeglut.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/freeglut.dll
--------------------------------------------------------------------------------
/bin/Debug/glut32.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/glut32.dll
--------------------------------------------------------------------------------
/bin/Debug/glut32.old.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Debug/glut32.old.dll
--------------------------------------------------------------------------------
/bin/Release/Assembler.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/Assembler.dll
--------------------------------------------------------------------------------
/bin/Release/Assembler.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/Assembler.lib
--------------------------------------------------------------------------------
/bin/Release/DevIL.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/DevIL.dll
--------------------------------------------------------------------------------
/bin/Release/ILU.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/ILU.dll
--------------------------------------------------------------------------------
/bin/Release/ILUT.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/ILUT.dll
--------------------------------------------------------------------------------
/bin/Release/NAudio.WindowsMediaFormat.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/NAudio.WindowsMediaFormat.dll
--------------------------------------------------------------------------------
/bin/Release/NAudio.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/NAudio.dll
--------------------------------------------------------------------------------
/bin/Release/OpenGLDemos.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/OpenGLDemos.exe
--------------------------------------------------------------------------------
/bin/Release/OpenGLDemos.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/bin/Release/OpenGLDotNet.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/OpenGLDotNet.dll
--------------------------------------------------------------------------------
/bin/Release/OpenGLDotNet.dll.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/bin/Release/data/cm_back.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/data/cm_back.jpg
--------------------------------------------------------------------------------
/bin/Release/data/cm_xneg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/data/cm_xneg.jpg
--------------------------------------------------------------------------------
/bin/Release/data/cm_xpos.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/data/cm_xpos.jpg
--------------------------------------------------------------------------------
/bin/Release/data/cm_yneg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/data/cm_yneg.jpg
--------------------------------------------------------------------------------
/bin/Release/data/cm_ypos.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/data/cm_ypos.jpg
--------------------------------------------------------------------------------
/bin/Release/data/cm_zneg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/data/cm_zneg.jpg
--------------------------------------------------------------------------------
/bin/Release/data/cm_zpos.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/data/cm_zpos.jpg
--------------------------------------------------------------------------------
/bin/Release/data/colormap.pcx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/data/colormap.pcx
--------------------------------------------------------------------------------
/bin/Release/data/conback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/data/conback.png
--------------------------------------------------------------------------------
/bin/Release/data/conback2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/data/conback2.jpg
--------------------------------------------------------------------------------
/bin/Release/data/conchars.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/data/conchars.png
--------------------------------------------------------------------------------
/bin/Release/freeglut.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/freeglut.dll
--------------------------------------------------------------------------------
/bin/Release/glut32.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/glut32.dll
--------------------------------------------------------------------------------
/bin/Release/glut32.old.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taylaninan/OpenGLDotNet/d68f482a1fc2df0d72e3cda5f3ad42770de51ede/bin/Release/glut32.old.dll
--------------------------------------------------------------------------------