mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-03 20:03:50 +00:00
refactor: complete OpenGL→Vulkan migration (Phase 7)
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Remove all OpenGL/GLEW code and dependencies. The Vulkan renderer has been the sole active backend for months; these files were dead code. Deleted (8 files, 641 lines): - rendering/mesh.cpp+hpp: OpenGL VAO/VBO/EBO wrapper (never instantiated) - rendering/shader.cpp+hpp: OpenGL GLSL compiler (replaced by VkShaderModule) - rendering/scene.cpp+hpp: Scene graph holding Mesh objects (created but never populated — all rendering uses Vulkan sub-renderers directly) - rendering/video_player.cpp+hpp: FFmpeg+GL texture uploader (never included by any other file — login video feature can be re-implemented with VkTexture when needed) Cleaned up: - renderer.hpp: remove Scene forward-decl, getScene() accessor, scene member - renderer.cpp: remove scene.hpp/shader.hpp includes, Scene create/destroy - application.cpp: remove stale "GL/glew.h removed" comment - CMakeLists.txt: remove find_package(OpenGL/GLEW), source/header entries, and target_link_libraries for OpenGL::GL and GLEW::GLEW - PKGBUILD: remove glew dependency - BUILD_INSTRUCTIONS.md: remove glew from all platform install commands
This commit is contained in:
parent
4b379f6fe9
commit
7cfaf2c7e9
14 changed files with 4 additions and 680 deletions
|
|
@ -1,33 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <GL/glew.h>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
namespace wowee {
|
||||
namespace rendering {
|
||||
|
||||
struct Vertex {
|
||||
glm::vec3 position;
|
||||
glm::vec3 normal;
|
||||
glm::vec2 texCoord;
|
||||
};
|
||||
|
||||
class Mesh {
|
||||
public:
|
||||
Mesh() = default;
|
||||
~Mesh();
|
||||
|
||||
void create(const std::vector<Vertex>& vertices, const std::vector<uint32_t>& indices);
|
||||
void destroy();
|
||||
void draw() const;
|
||||
|
||||
private:
|
||||
GLuint VAO = 0;
|
||||
GLuint VBO = 0;
|
||||
GLuint EBO = 0;
|
||||
size_t indexCount = 0;
|
||||
};
|
||||
|
||||
} // namespace rendering
|
||||
} // namespace wowee
|
||||
|
|
@ -30,7 +30,6 @@ namespace rendering {
|
|||
|
||||
class Camera;
|
||||
class CameraController;
|
||||
class Scene;
|
||||
class TerrainRenderer;
|
||||
class TerrainManager;
|
||||
class PerformanceHUD;
|
||||
|
|
@ -54,7 +53,6 @@ class Minimap;
|
|||
class WorldMap;
|
||||
class QuestMarkerRenderer;
|
||||
class CharacterPreview;
|
||||
class Shader;
|
||||
class AmdFsr3Runtime;
|
||||
|
||||
class Renderer {
|
||||
|
|
@ -119,7 +117,6 @@ public:
|
|||
|
||||
Camera* getCamera() { return camera.get(); }
|
||||
CameraController* getCameraController() { return cameraController.get(); }
|
||||
Scene* getScene() { return scene.get(); }
|
||||
TerrainRenderer* getTerrainRenderer() const { return terrainRenderer.get(); }
|
||||
TerrainManager* getTerrainManager() const { return terrainManager.get(); }
|
||||
PerformanceHUD* getPerformanceHUD() { return performanceHUD.get(); }
|
||||
|
|
@ -219,7 +216,6 @@ private:
|
|||
core::Window* window = nullptr;
|
||||
std::unique_ptr<Camera> camera;
|
||||
std::unique_ptr<CameraController> cameraController;
|
||||
std::unique_ptr<Scene> scene;
|
||||
std::unique_ptr<TerrainRenderer> terrainRenderer;
|
||||
std::unique_ptr<TerrainManager> terrainManager;
|
||||
std::unique_ptr<PerformanceHUD> performanceHUD;
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
namespace wowee {
|
||||
namespace rendering {
|
||||
|
||||
class Mesh;
|
||||
|
||||
class Scene {
|
||||
public:
|
||||
Scene() = default;
|
||||
~Scene() = default;
|
||||
|
||||
void addMesh(std::shared_ptr<Mesh> mesh);
|
||||
void removeMesh(const std::shared_ptr<Mesh>& mesh);
|
||||
void clear();
|
||||
|
||||
const std::vector<std::shared_ptr<Mesh>>& getMeshes() const { return meshes; }
|
||||
|
||||
private:
|
||||
std::vector<std::shared_ptr<Mesh>> meshes;
|
||||
};
|
||||
|
||||
} // namespace rendering
|
||||
} // namespace wowee
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <GL/glew.h>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
namespace wowee {
|
||||
namespace rendering {
|
||||
|
||||
class Shader {
|
||||
public:
|
||||
Shader() = default;
|
||||
~Shader();
|
||||
|
||||
[[nodiscard]] bool loadFromFile(const std::string& vertexPath, const std::string& fragmentPath);
|
||||
[[nodiscard]] bool loadFromSource(const std::string& vertexSource, const std::string& fragmentSource);
|
||||
|
||||
void use() const;
|
||||
void unuse() const;
|
||||
|
||||
void setUniform(const std::string& name, int value);
|
||||
void setUniform(const std::string& name, float value);
|
||||
void setUniform(const std::string& name, const glm::vec2& value);
|
||||
void setUniform(const std::string& name, const glm::vec3& value);
|
||||
void setUniform(const std::string& name, const glm::vec4& value);
|
||||
void setUniform(const std::string& name, const glm::mat3& value);
|
||||
void setUniform(const std::string& name, const glm::mat4& value);
|
||||
void setUniformMatrixArray(const std::string& name, const glm::mat4* matrices, int count);
|
||||
|
||||
GLuint getProgram() const { return program; }
|
||||
|
||||
// Adopt an externally-created program (no ownership of individual shaders)
|
||||
void setProgram(GLuint prog) { program = prog; }
|
||||
// Release ownership without deleting (caller retains the GL program)
|
||||
void releaseProgram() { program = 0; vertexShader = 0; fragmentShader = 0; }
|
||||
|
||||
private:
|
||||
bool compile(const std::string& vertexSource, const std::string& fragmentSource);
|
||||
GLint getUniformLocation(const std::string& name) const;
|
||||
|
||||
GLuint program = 0;
|
||||
GLuint vertexShader = 0;
|
||||
GLuint fragmentShader = 0;
|
||||
|
||||
// Cache uniform locations to avoid expensive glGetUniformLocation calls
|
||||
mutable std::unordered_map<std::string, GLint> uniformLocationCache;
|
||||
};
|
||||
|
||||
} // namespace rendering
|
||||
} // namespace wowee
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
typedef unsigned int GLuint;
|
||||
|
||||
namespace wowee {
|
||||
namespace rendering {
|
||||
|
||||
class VideoPlayer {
|
||||
public:
|
||||
VideoPlayer();
|
||||
~VideoPlayer();
|
||||
|
||||
bool open(const std::string& path);
|
||||
void update(float deltaTime);
|
||||
void close();
|
||||
|
||||
bool isReady() const { return textureReady; }
|
||||
GLuint getTextureId() const { return textureId; }
|
||||
int getWidth() const { return width; }
|
||||
int getHeight() const { return height; }
|
||||
|
||||
private:
|
||||
bool decodeNextFrame();
|
||||
void uploadFrame();
|
||||
|
||||
void* formatCtx = nullptr;
|
||||
void* codecCtx = nullptr;
|
||||
void* frame = nullptr;
|
||||
void* rgbFrame = nullptr;
|
||||
void* packet = nullptr;
|
||||
void* swsCtx = nullptr;
|
||||
|
||||
int videoStreamIndex = -1;
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
double frameTime = 1.0 / 30.0;
|
||||
double accumulator = 0.0;
|
||||
bool eof = false;
|
||||
|
||||
GLuint textureId = 0;
|
||||
bool textureReady = false;
|
||||
std::string sourcePath;
|
||||
std::vector<uint8_t> rgbBuffer;
|
||||
};
|
||||
|
||||
} // namespace rendering
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue