suyu/src/video_core/renderer_opengl/gl_shaders.h
Kevin Hartman cbfd6b6e52 Rewrite of OpenGL renderer, including OS X support
Screen contents are now displayed using textured quads. This can be updated to expose an FBO once an OpenGL backend for when Pica rendering is being worked on. That FBO's texture can then be applied to the quads.

Previously, FBO blitting was used in order to display screen contents, which did not work on OS X. The new textured quad approach is less of a compatibility risk.
2014-08-25 20:56:59 -07:00

39 lines
850 B
C++

// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#pragma once
namespace GLShaders {
static const char g_vertex_shader[] = R"(
#version 330 core
layout(location = 0) in vec3 position;
layout(location = 1) in vec2 texCoord;
out vec2 UV;
mat3 window_scale = mat3(
vec3(1.0, 0.0, 0.0),
vec3(0.0, 5.0/6.0, 0.0), // TODO(princesspeachum): replace hard-coded aspect with uniform
vec3(0.0, 0.0, 1.0)
);
void main() {
gl_Position.xyz = window_scale * position;
gl_Position.w = 1.0;
UV = texCoord;
})";
static const char g_fragment_shader[] = R"(
#version 330 core
in vec2 UV;
out vec3 color;
uniform sampler2D sampler;
void main() {
color = texture(sampler, UV).rgb;
})";
}