- [FIX] glViewport() s'ha de fixar quan estem treballant contra la pantalla, al final

- [FIX] invertida la textura en l'eix Y
This commit is contained in:
2024-06-27 12:21:49 +02:00
parent 0efbe28bd6
commit 6afca2f2a6
3 changed files with 16 additions and 9 deletions

View File

@@ -78,7 +78,7 @@ bool initGLExtensions() {
#endif
GLuint compileShader(const char* source, GLuint shaderType) {
std::cout << "Compilando shader:" << std::endl << source << std::endl;
//std::cout << "Compilando shader:" << std::endl << source << std::endl;
// Create ID for shader
GLuint result = glCreateShader(shaderType);
// Define shader text
@@ -170,14 +170,16 @@ void presentBackBuffer(SDL_Renderer *renderer, SDL_Window* win, SDL_Texture* bac
// Coordenadas de la ventana donde pintar.
minx = 0.0f;
miny = 0.0f;
maxx = WIN_WIDTH;
maxy = WIN_HEIGHT;
maxx = WORLD_WIDTH;
maxy = WORLD_HEIGHT;
minu = 0.0f;
maxu = 1.0f;
minv = 0.0f;
maxv = 1.0f;
glViewport(0, 0, WIN_WIDTH, WIN_HEIGHT);
glBegin(GL_TRIANGLE_STRIP);
glTexCoord2f(minu, minv);
glVertex2f(minx, miny);