Skip to content

Commit

Permalink
raspberry pi 3 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
krazynez committed Jan 30, 2025
1 parent 407841c commit a23087e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ else()

elseif(UNIX)
if ((${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64" AND CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv" AND CMAKE_SYSTEM_NAME STREQUAL "Linux"))
option(DAEDALUS_GLES "OpenGLES 3.1 Renderer" ON)
option(DAEDALUS_GLES "OpenGLES 2.1 Renderer" ON)
else()
option(DAEDALUS_GL "OpenGL Renderer" ON)
endif()
Expand Down
2 changes: 1 addition & 1 deletion Source/SysGLES/GL.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef SYSGLES_GL_H_
#define SYSGLES_GL_H_

#include <GLES3/gl3.h>
#include <GLES2/gl2.h>
#include <SDL2/SDL_opengl.h>
#include <SDL2/SDL.h>

Expand Down
2 changes: 1 addition & 1 deletion Source/SysGLES/Graphics/GraphicsContextGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ bool GraphicsContextGL::Initialise()

// Create the window
gWindow = SDL_CreateWindow(
"Daedalus - GLES 3.1",
"Daedalus - GLES 2.1",
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
SCREEN_WIDTH,
Expand Down
9 changes: 6 additions & 3 deletions Source/SysGLES/HLEGraphics/RendererGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <iostream>
#include <filesystem>

#include <GLES3/gl3.h>
#include <GLES2/gl2.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
#include <SDL2/SDL_syswm.h>
Expand Down Expand Up @@ -112,8 +112,8 @@ bool initgl()
gRDPStateManager.SetEmulateMirror(!gAccurateUVPipe);

// Generate VAO
glGenVertexArrays(1, &gVAO);
glBindVertexArray(gVAO);
//glGenVertexArrays(1, &gVAO);
//glBindVertexArray(gVAO);

// Generate VBOs
glGenBuffers(kNumBuffers, gVBOs);
Expand All @@ -130,6 +130,9 @@ bool initgl()
glBindBuffer(GL_ARRAY_BUFFER, gVBOs[kColorBuffer]);
glBufferData(GL_ARRAY_BUFFER, sizeof(gColorBuffer), gColorBuffer, GL_DYNAMIC_DRAW);

glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), (void*)0);

return true;
}

Expand Down
4 changes: 2 additions & 2 deletions Source/SysGLES/HLEGraphics/n64.psh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ precision highp int;
// 1. Macro trick to avoid redefinition of built-in in ES 3.0
// --------------------------------------------------------
#ifdef GL_ES
#if __VERSION__ < 310
#if __VERSION__ < 210
// Only apply if we really end up at ES 3.0 environment
#define texelFetch myTexelFetch
#endif
Expand Down Expand Up @@ -305,4 +305,4 @@ vec4 fetchSimple(

vec2 uvf = (vec2(uv) - vec2(tile_tl << 3)) * (tex_scale / 32.0);
return texture(tex, uvf);
}
}

0 comments on commit a23087e

Please sign in to comment.