Skip to content

OpenGL ES #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Data/Base.rte/Shaders/Blit8.frag
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
// Blit8.frag
#version 330 core
#version 300 es

in vec2 textureUV;
precision highp float;
precision highp sampler2D;

out vec4 FragColor;
in highp vec2 textureUV;

uniform sampler2D rteTexture;
uniform sampler2D rtePalette;
out highp vec4 FragColor;

uniform highp sampler2D rteTexture;
uniform highp sampler2D rtePalette;

void main() {
float colorIndex = texture(rteTexture, vec2(textureUV.x, -textureUV.y)).r;
Expand Down
16 changes: 9 additions & 7 deletions Data/Base.rte/Shaders/Blit8.vert
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#version 330 core
#version 300 es

layout(location = 0) in vec2 rteVertexPosition;
layout(location = 1) in vec2 rteTexUV;
precision highp float;

out vec2 textureUV;
layout(location = 0) in highp vec2 rteVertexPosition;
layout(location = 1) in highp vec2 rteTexUV;

uniform mat4 rteTransform;
uniform mat4 rteProjection;
uniform mat4 rteUVTransform;
out highp vec2 textureUV;

uniform highp mat4 rteTransform;
uniform highp mat4 rteProjection;
uniform highp mat4 rteUVTransform;

void main() {
gl_Position = rteProjection * rteTransform * vec4(rteVertexPosition, 0.0, 1.0);
Expand Down
13 changes: 8 additions & 5 deletions Data/Base.rte/Shaders/PostProcess.frag
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#version 330 core
#version 300 es

in vec2 textureUV;
precision highp float;
precision highp sampler2D;

out vec4 FragColor;
in highp vec2 textureUV;

uniform sampler2D rteTexture;
uniform vec4 rteColor;
out highp vec4 FragColor;

uniform highp sampler2D rteTexture;
uniform highp vec4 rteColor;

void main() {
FragColor = texture(rteTexture, textureUV) * rteColor;
Expand Down
14 changes: 8 additions & 6 deletions Data/Base.rte/Shaders/PostProcess.vert
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#version 330 core
#version 300 es

layout(location = 0) in vec2 rteVertexPosition;
layout(location = 1) in vec2 rteTexUV;
precision highp float;

out vec2 textureUV;
layout(location = 0) in highp vec2 rteVertexPosition;
layout(location = 1) in highp vec2 rteTexUV;

uniform mat4 rteTransform;
uniform mat4 rteProjection;
out highp vec2 textureUV;

uniform highp mat4 rteTransform;
uniform highp mat4 rteProjection;

void main() {
gl_Position = rteProjection * rteTransform * vec4(rteVertexPosition, 0.0, 1.0);
Expand Down
13 changes: 8 additions & 5 deletions Data/Base.rte/Shaders/ScreenBlit.frag
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#version 330 core
#version 300 es

in vec2 textureUV;
precision highp float;
precision highp sampler2D;

out vec4 FragColor;
in highp vec2 textureUV;

uniform sampler2D rteTexture;
uniform sampler2D rteGUITexture;
out highp vec4 FragColor;

uniform highp sampler2D rteTexture;
uniform highp sampler2D rteGUITexture;

vec4 texture2DAA(sampler2D tex, vec2 uv) {
vec2 texsize = vec2(textureSize(tex, 0));
Expand Down
14 changes: 8 additions & 6 deletions Data/Base.rte/Shaders/ScreenBlit.vert
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#version 330 core
#version 300 es

layout(location = 0) in vec2 rteVertexPosition;
layout(location = 1) in vec2 rteTexUV;
precision highp float;

out vec2 textureUV;
layout(location = 0) in highp vec2 rteVertexPosition;
layout(location = 1) in highp vec2 rteTexUV;

uniform mat4 rteTransform;
uniform mat4 rteProjection;
out highp vec2 textureUV;

uniform highp mat4 rteTransform;
uniform highp mat4 rteProjection;

void main() {
gl_Position = rteProjection * rteTransform * vec4(rteVertexPosition.xy, 0.0, 1.0);
Expand Down
4 changes: 2 additions & 2 deletions Source/Managers/WindowMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ void WindowMan::Initialize() {

SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
CreatePrimaryWindow();
InitializeOpenGL();
CreateBackBufferTexture();
Expand Down