-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #595 from leezer3/OpenGLMenu
New: OpenGL Main Menu (for systems not supporting WinForms)
- Loading branch information
Showing
87 changed files
with
2,804 additions
and
991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#version 150 | ||
#version 150 core | ||
precision highp int; | ||
|
||
struct Light | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#version 150 | ||
|
||
#version 150 core | ||
uniform int uObjectIndex; | ||
out vec4 fragColor; | ||
|
||
void main(void) | ||
{ | ||
gl_FragData[0].r = float(uObjectIndex); | ||
fragColor.r = float(uObjectIndex); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#version 150 core | ||
in vec2 textureCoord; | ||
uniform int uAlphaFunction; | ||
uniform float uAlphaComparison; | ||
uniform bool uRectangleHasColour; | ||
uniform vec4 uColor; | ||
uniform sampler2D uTexture; | ||
out vec4 fragColor; | ||
|
||
void main(void) | ||
{ | ||
vec4 textureColour = texture(uTexture, textureCoord); | ||
|
||
vec4 finalColor = textureColour * uColor; | ||
|
||
/* | ||
* NOTES: | ||
* Unused alpha functions must not be added to the shader | ||
* This has a nasty affect on framerates | ||
* | ||
* A switch case block is also ~30% slower than the else-if | ||
* | ||
* Numbers used are those from the GL.AlphaFunction enum to allow | ||
* for direct casts | ||
*/ | ||
if(uAlphaFunction == 513) // Less | ||
{ | ||
if(finalColor.a >= uAlphaComparison) | ||
{ | ||
discard; | ||
} | ||
} | ||
else if(uAlphaFunction == 514) // Equal | ||
{ | ||
if(!(abs(finalColor.a - 1.0) < 0.00001)) | ||
{ | ||
discard; | ||
} | ||
} | ||
else if(uAlphaFunction == 516) // Greater | ||
{ | ||
if(finalColor.a <= uAlphaComparison) | ||
{ | ||
discard; | ||
} | ||
} | ||
|
||
fragColor = finalColor; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#version 150 core | ||
uniform mat4 uCurrentProjectionMatrix; | ||
uniform mat4 uCurrentModelViewMatrix; | ||
uniform vec2 uPoint; | ||
uniform vec2 uSize; | ||
uniform vec2 uCoordinates; | ||
out vec2 textureCoord; | ||
vec4 viewPos = vec4(0,0,0,0); | ||
|
||
void main() | ||
{ | ||
if(gl_VertexID == 0) | ||
{ | ||
viewPos = uCurrentModelViewMatrix * vec4(vec3(uPoint.x, uPoint.y, 0), 1.0); | ||
textureCoord = vec2(0,0); | ||
} | ||
else if (gl_VertexID == 1) | ||
{ | ||
viewPos = uCurrentModelViewMatrix * vec4(vec3(uPoint.x + uSize.x, uPoint.y, 0), 1.0); | ||
textureCoord = vec2(uCoordinates.x,0); | ||
} | ||
else if (gl_VertexID == 2) | ||
{ | ||
viewPos = uCurrentModelViewMatrix * vec4(vec3(uPoint.x + uSize.x, uPoint.y + uSize.y, 0), 1.0); | ||
textureCoord = uCoordinates; | ||
} | ||
else if (gl_VertexID == 3) | ||
{ | ||
viewPos = uCurrentModelViewMatrix * vec4(vec3(uPoint.x, uPoint.y, 0), 1.0); | ||
textureCoord = vec2(0,0); | ||
} | ||
else if (gl_VertexID == 4) | ||
{ | ||
viewPos = uCurrentModelViewMatrix * vec4(vec3(uPoint.x, uPoint.y + uSize.y, 0), 1.0); | ||
textureCoord = vec2(0, uCoordinates.y); | ||
} | ||
else if (gl_VertexID == 5) | ||
{ | ||
viewPos = uCurrentModelViewMatrix * vec4(vec3(uPoint.x + uSize.x, uPoint.y + uSize.y, 0), 1.0); | ||
textureCoord = uCoordinates; | ||
} | ||
|
||
gl_Position = uCurrentProjectionMatrix * viewPos; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#version 150 core | ||
|
||
uniform mat4 uCurrentProjectionMatrix; | ||
uniform mat4 uCurrentModelViewMatrix; | ||
uniform vec2 uPoint; | ||
uniform vec2 uSize; | ||
uniform vec4 uAtlasLocation; | ||
out vec2 textureCoord; | ||
vec4 viewPos = vec4(0,0,0,0); | ||
|
||
void main() | ||
{ | ||
switch(gl_VertexID) | ||
{ | ||
case 0: | ||
viewPos = uCurrentModelViewMatrix * vec4(vec3(uPoint.x, uPoint.y, 0), 1.0); | ||
textureCoord = vec2(uAtlasLocation.x, uAtlasLocation.y); | ||
break; | ||
case 1: | ||
viewPos = uCurrentModelViewMatrix * vec4(vec3(uPoint.x + uSize.x, uPoint.y, 0), 1.0); | ||
textureCoord = vec2(uAtlasLocation.x + uAtlasLocation.z, uAtlasLocation.y); | ||
break; | ||
case 2: | ||
viewPos = uCurrentModelViewMatrix * vec4(vec3(uPoint.x + uSize.x, uPoint.y + uSize.y, 0), 1.0); | ||
textureCoord = vec2(uAtlasLocation.x + uAtlasLocation.z, uAtlasLocation.y + uAtlasLocation.w); | ||
break; | ||
case 3: | ||
viewPos = uCurrentModelViewMatrix * vec4(vec3(uPoint.x, uPoint.y, 0), 1.0); | ||
textureCoord = vec2(uAtlasLocation.x, uAtlasLocation.y); | ||
break; | ||
case 4: | ||
viewPos = uCurrentModelViewMatrix * vec4(vec3(uPoint.x, uPoint.y + uSize.y, 0), 1.0); | ||
textureCoord = vec2(uAtlasLocation.x, uAtlasLocation.y + uAtlasLocation.w); | ||
break; | ||
case 5: | ||
viewPos = uCurrentModelViewMatrix * vec4(vec3(uPoint.x + uSize.x, uPoint.y + uSize.y, 0), 1.0); | ||
textureCoord = vec2(uAtlasLocation.x + uAtlasLocation.z, uAtlasLocation.y + uAtlasLocation.w); | ||
break; | ||
} | ||
gl_Position = uCurrentProjectionMatrix * viewPos; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.