Skip to content

Commit

Permalink
Removed most references to OpenGL.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Oct 29, 2023
1 parent 870ef40 commit 00fa948
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 20 deletions.
1 change: 0 additions & 1 deletion source/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ if (NOT MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE ${CLANG_FLAGS})
endif ()

target_compile_options(${PROJECT_NAME} PRIVATE -DGLM_FORCE_RADIANS)
target_compile_options(${PROJECT_NAME} PRIVATE -D_USE_MATH_DEFINES)
target_compile_options(${PROJECT_NAME} PRIVATE -DSOL_CHECK_ARGUMENTS -DSOL_PRINT_ERRORS=0)

Expand Down
14 changes: 6 additions & 8 deletions source/client/core/Vertex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@
#ifndef VERTEX_HPP_
#define VERTEX_HPP_

#include <gk/gl/OpenGL.hpp>

struct Vertex {
GLfloat coord3d[4] = {0, 0, 0, 1};
GLfloat texCoord[2] = {-1, -1};
GLfloat color[4] = {0, 0, 0, 1};
GLfloat normal[3] = {0, 0, 0};
GLfloat lightValue[2] = {-1, -1};
GLfloat ambientOcclusion = 4;
float coord3d[4] = {0, 0, 0, 1};
float texCoord[2] = {-1, -1};
float color[4] = {0, 0, 0, 1};
float normal[3] = {0, 0, 0};
float lightValue[2] = {-1, -1};
float ambientOcclusion = 4;
};

#endif // VERTEX_HPP_
2 changes: 1 addition & 1 deletion source/client/graphics/ChunkRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static bool fullyOutside(const glm::vec3 &v1, const glm::vec3 &v2, const glm::ve
void ChunkRenderer::draw(RenderTarget &target, RenderStates states, const ChunkMap &chunks, Camera &camera, const Sky *currentSky) const {
// Changing the values sent to the GPU to double precision is suicidal,
// performance wise, if possible at all. Therefore we want to keep the
// GL rendering numbers in single precision format. But that introduces
// BGFX rendering numbers in single precision format. But that introduces
// an issue at larger coordinates, because the precision of floats
// quickly degrades as the numbers grow, with a random wobbling being
// very noticeable at e.g. coordinates >= 65536 or so, and the waving
Expand Down
1 change: 0 additions & 1 deletion source/client/graphics/TextureAtlas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
*/
#include <gk/core/Exception.hpp>
#include <gk/core/Filesystem.hpp>
#include <gk/gl/OpenGL.hpp>

#include "Registry.hpp"
#include "TextureAtlas.hpp"
Expand Down
4 changes: 2 additions & 2 deletions source/client/hud/BlockCursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ void BlockCursor::updateAnimationVertexBuffer(const BlockState &blockState, u8f
Vertex vertices[nFaces][nVertsPerFace];
updateVBOCoords(vertices, blockState, -2, orientation);

GLfloat color[4] = {1, 1, 1, 0.5};
float color[4] = {1, 1, 1, 0.5};
for (u8f f = 0; f < nFaces; ++f)
for (u8f v = 0; v < nVertsPerFace; ++v)
memcpy(&vertices[f][v].color, &color[0], 4 * sizeof(GLfloat));
memcpy(&vertices[f][v].color, &color[0], 4 * sizeof(float));

if (animationPos != -1) {
glm::vec4 blockTexCoords{0.1f * (float)animationPos, 0.0f, 0.1f + 0.1f * (float)animationPos, 1.0f};
Expand Down
1 change: 0 additions & 1 deletion source/client/states/GameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <gk/core/input/GamePad.hpp>
#include <gk/core/Exception.hpp>
#include <gk/core/GameClock.hpp>
#include <gk/gl/OpenGL.hpp>
#include <gk/resource/ResourceHandler.hpp>

#include "ApplicationStateStack.hpp"
Expand Down
2 changes: 0 additions & 2 deletions source/client/states/TitleScreenState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
#include "ServerApplication.hpp" // For ServerOnlineEvent

TitleScreenState::TitleScreenState(u16 port) : m_port(port) {
glClearColor(0.0, 0.0, 0.0, 1.0);

m_menuWidget.setScale(Config::guiScale, Config::guiScale);

m_menuWidget.addButton("Singleplayer", [this] (TextButton &) {
Expand Down
2 changes: 0 additions & 2 deletions source/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ if (NOT MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE ${CLANG_FLAGS})
endif ()

target_compile_options(${PROJECT_NAME} PRIVATE -DGLM_FORCE_RADIANS)
target_compile_options(${PROJECT_NAME} PRIVATE -D_USE_MATH_DEFINES)
target_compile_options(${PROJECT_NAME} PRIVATE -DSOL_CHECK_ARGUMENTS -DSOL_PRINT_ERRORS=0)

Expand All @@ -60,7 +59,6 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
gamekit
zlib
EnTT
${OPENGL_LIBRARIES}
${UNIX_LIBS}
)

2 changes: 0 additions & 2 deletions source/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ if (NOT MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE ${CLANG_FLAGS})
endif ()

target_compile_options(${PROJECT_NAME}_lib PRIVATE -DGLM_FORCE_RADIANS)
target_compile_options(${PROJECT_NAME}_lib PRIVATE -D_USE_MATH_DEFINES)
target_compile_options(${PROJECT_NAME}_lib PRIVATE -DSOL_CHECK_ARGUMENTS -DSOL_PRINT_ERRORS=0)

target_compile_options(${PROJECT_NAME} PRIVATE -DGLM_FORCE_RADIANS)
target_compile_options(${PROJECT_NAME} PRIVATE -D_USE_MATH_DEFINES)
target_compile_options(${PROJECT_NAME} PRIVATE -DSOL_CHECK_ARGUMENTS -DSOL_PRINT_ERRORS=0)

Expand Down

0 comments on commit 00fa948

Please sign in to comment.