- [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:
8
main.cpp
8
main.cpp
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user