group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
IRenderer.hpp
Go to the documentation of this file.
1
9
10#pragma once
11
12#include "Camera.hpp"
13#include "ModelLoader.hpp"
14#include "RendererTypes.hpp" // EntityRenderCmd, WeaponViewmodel, RenderToggles
15
16#include <SDL3/SDL.h>
17
18#include <glm/glm.hpp>
19#include <string>
20#include <vector>
21
22class ParticleSystem;
23
49
53{
54public:
55 virtual ~IRenderer() = default;
56
58 [[nodiscard]] virtual bool supports(RendererFeature feature) const = 0;
59
60 virtual bool init(SDL_Window* window) = 0;
61 virtual void drawFrame(glm::vec3 eye, float yaw, float pitch, float roll) = 0;
62 virtual void quit() = 0;
63
64 [[nodiscard]] virtual SDL_GPUDevice* getDevice() const = 0;
65 [[nodiscard]] virtual SDL_GPUShaderFormat getShaderFormat() const = 0;
66 [[nodiscard]] virtual const Camera& getCamera() const = 0;
67
68 virtual void setParticleSystem(ParticleSystem* ps) = 0;
69 virtual int loadSceneModel(const char* filename, glm::vec3 pos, float scale, bool flipUVs) = 0;
70 virtual int uploadSceneModel(const LoadedModel& model) = 0;
71 virtual bool setVSync(bool enabled) = 0;
72 virtual void
73 updateModelMeshVertices(int modelIndex, int meshIndex, const ModelVertex* vertices, Uint32 vertexCount) = 0;
74 virtual void setEntityRenderList(std::vector<EntityRenderCmd> cmds) = 0;
75 virtual void setPointLights(std::vector<PointLight> lights) = 0;
76 virtual void setModelEmissive(int modelIndex, glm::vec4 emissiveFactor) = 0;
77 virtual void setWeaponViewmodel(const WeaponViewmodel& vm) = 0;
78 virtual void requestScreenshot(const std::string& path) = 0;
79 [[nodiscard]] virtual int modelCount() const = 0;
80};
RendererFeature
Stable identifiers for each dispatchable renderer method.
Definition IRenderer.hpp:31
Assimp-based model loading and CPU-side mesh/texture data types.
Shared data types used across renderer implementations.
Definition Camera.hpp:6
Abstract renderer contract.
Definition IRenderer.hpp:53
virtual SDL_GPUDevice * getDevice() const =0
virtual int uploadSceneModel(const LoadedModel &model)=0
virtual void drawFrame(glm::vec3 eye, float yaw, float pitch, float roll)=0
virtual SDL_GPUShaderFormat getShaderFormat() const =0
virtual void setParticleSystem(ParticleSystem *ps)=0
virtual const Camera & getCamera() const =0
virtual bool init(SDL_Window *window)=0
virtual int modelCount() const =0
virtual void requestScreenshot(const std::string &path)=0
virtual void setPointLights(std::vector< PointLight > lights)=0
virtual void setWeaponViewmodel(const WeaponViewmodel &vm)=0
virtual void updateModelMeshVertices(int modelIndex, int meshIndex, const ModelVertex *vertices, Uint32 vertexCount)=0
virtual ~IRenderer()=default
virtual void setEntityRenderList(std::vector< EntityRenderCmd > cmds)=0
virtual int loadSceneModel(const char *filename, glm::vec3 pos, float scale, bool flipUVs)=0
virtual void setModelEmissive(int modelIndex, glm::vec4 emissiveFactor)=0
virtual bool setVSync(bool enabled)=0
virtual void quit()=0
virtual bool supports(RendererFeature feature) const =0
Return true iff this renderer implements the given feature.
Top-level particle system orchestrator.
Definition ParticleSystem.hpp:35
Everything returned by loadModel().
Definition ModelLoader.hpp:76
One vertex in a loaded 3-D model (PBR-ready).
Definition ModelLoader.hpp:19
First-person weapon viewmodel descriptor sent per frame.
Definition RendererTypes.hpp:65