mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-25 23:29:55 -06:00
make it more functional and betterer
atleast now it's not worse than what it was before, so we can start building real shit
This commit is contained in:
@ -51,6 +51,8 @@ bool Init()
|
|||||||
|
|
||||||
for (int i = 0; i < 1; i++)
|
for (int i = 0; i < 1; i++)
|
||||||
{
|
{
|
||||||
|
GLint uni_id;
|
||||||
|
|
||||||
glBindAttribLocation(CompShader[i][2], 0, "vPosition");
|
glBindAttribLocation(CompShader[i][2], 0, "vPosition");
|
||||||
glBindFragDataLocation(CompShader[i][2], 0, "oColor");
|
glBindFragDataLocation(CompShader[i][2], 0, "oColor");
|
||||||
|
|
||||||
@ -58,6 +60,12 @@ bool Init()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
CompScaleLoc[i] = glGetUniformLocation(CompShader[i][2], "u3DScale");
|
CompScaleLoc[i] = glGetUniformLocation(CompShader[i][2], "u3DScale");
|
||||||
|
|
||||||
|
glUseProgram(CompShader[i][2]);
|
||||||
|
uni_id = glGetUniformLocation(CompShader[i][2], "ScreenTex");
|
||||||
|
glUniform1i(uni_id, 0);
|
||||||
|
uni_id = glGetUniformLocation(CompShader[i][2], "_3DTex");
|
||||||
|
glUniform1i(uni_id, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SETVERTEX(i, x, y) \
|
#define SETVERTEX(i, x, y) \
|
||||||
|
@ -33,7 +33,7 @@ void main()
|
|||||||
fpos.w = 1.0;
|
fpos.w = 1.0;
|
||||||
|
|
||||||
gl_Position = fpos;
|
gl_Position = fpos;
|
||||||
fTexcoord = (vPosition + vec2(1.0, -1.0)) * (vec2(256.0, -384.0) / 2.0);
|
fTexcoord = (vPosition + vec2(1.0, 1.0)) * (vec2(256.0, 384.0) / 2.0);
|
||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
|
|
||||||
|
@ -410,31 +410,31 @@ void GLScreen_DrawScreen()
|
|||||||
switch (ScreenRotation)
|
switch (ScreenRotation)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
s0 = 0; t0 = 192;
|
s0 = 0; t0 = scheight;
|
||||||
s1 = scwidth; t1 = 192;
|
s1 = scwidth; t1 = scheight;
|
||||||
s2 = 0; t2 = 192+scheight;
|
s2 = 0; t2 = scheight+scheight;
|
||||||
s3 = scwidth; t3 = 192+scheight;
|
s3 = scwidth; t3 = scheight+scheight;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
s0 = 0; t0 = 192+scheight;
|
s0 = 0; t0 = scheight+scheight;
|
||||||
s1 = 0; t1 = 192;
|
s1 = 0; t1 = scheight;
|
||||||
s2 = scwidth; t2 = 192+scheight;
|
s2 = scwidth; t2 = scheight+scheight;
|
||||||
s3 = scwidth; t3 = 192;
|
s3 = scwidth; t3 = scheight;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
s0 = scwidth; t0 = 192+scheight;
|
s0 = scwidth; t0 = scheight+scheight;
|
||||||
s1 = 0; t1 = 192+scheight;
|
s1 = 0; t1 = scheight+scheight;
|
||||||
s2 = scwidth; t2 = 192;
|
s2 = scwidth; t2 = scheight;
|
||||||
s3 = 0; t3 = 192;
|
s3 = 0; t3 = scheight;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
s0 = scwidth; t0 = 192;
|
s0 = scwidth; t0 = scheight;
|
||||||
s1 = scwidth; t1 = 192+scheight;
|
s1 = scwidth; t1 = scheight+scheight;
|
||||||
s2 = 0; t2 = 192;
|
s2 = 0; t2 = scheight;
|
||||||
s3 = 0; t3 = 192+scheight;
|
s3 = 0; t3 = scheight+scheight;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,11 +63,11 @@ out vec4 oColor;
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
ivec4 pixel = ivec4(texelFetch(ScreenTex, ivec2(fTexcoord), 0));
|
//ivec4 pixel = ivec4(texelFetch(ScreenTex, ivec2(fTexcoord), 0));
|
||||||
|
|
||||||
// TODO: filters
|
// TODO: filters
|
||||||
|
|
||||||
oColor = vec4(vec3(pixel.bgr) / 255.0, 1.0);
|
//oColor = vec4(vec3(pixel.bgr) / 255.0, 1.0);
|
||||||
oColor = texelFetch(ScreenTex, ivec2(fTexcoord), 0);
|
oColor = texelFetch(ScreenTex, ivec2(fTexcoord), 0);
|
||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
|
Reference in New Issue
Block a user