Fixed PSP rendering

This commit is contained in:
2025-11-09 14:54:33 -06:00
parent 587d716aae
commit aaa8622956
11 changed files with 30 additions and 8 deletions

View File

@@ -52,6 +52,11 @@ void cameraPushMatrix(camera_t *camera) {
switch(camera->projType) {
case CAMERA_PROJECTION_TYPE_ORTHOGRAPHIC:
assertTrue(
camera->orthographic.right != camera->orthographic.left &&
camera->orthographic.top != camera->orthographic.bottom,
"Invalid orthographic projection parameters"
);
glm_ortho(
camera->orthographic.left,
camera->orthographic.right,
@@ -117,7 +122,6 @@ void cameraPushMatrix(camera_t *camera) {
glm_vec3_copy(camera->lookatPixelPerfect.target, position);
glm_vec3_add(position, camera->lookatPixelPerfect.offset, position);
position[2] += z;
glm_lookat(
position,
camera->lookatPixelPerfect.target,

View File

@@ -41,6 +41,9 @@ void screenInit() {
SCREEN.frameBufferMeshVertices
);
#endif
// Init screen to backbuffer mode by default
screenBind();
}
void screenBind() {

View File

@@ -170,6 +170,7 @@ void textureBind(const texture_t *texture) {
#if DISPLAY_SDL2
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture->id);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
#endif
TEXTURE_BOUND = texture;
}