Files
jak-project/game/graphics/opengl_renderer/OpenGLRenderer.h
T
ManDude 9ff71412e5 [runtime] pckernel implementation (#1032)
* toggle for ripping level models

* Create pckernel.gc

* builds and works

* fix defs

* resolution info works

* native letterboxing

* menu

* Fullscreen buttons

* Update glfw

* fix fullscreen taking over everything for some reason

* fix screenshots and add more menu options

* Cleanup DMA mess in load boundary render code (first try!!)

* Update default-menu.gc

* clang

* fix accidental macros in pairs

* refs

* fix null reference bugs

* add lavatube

* custom aspect ratios work (3D only)

* custom aspect ratios work (3D only)

* fix aspect ratio and non-4x3 debug text

* change `sceOpen`

* deadzone setting

* merge fixes

* check out `debug-pad-display`

* update readme imgs

* settings save works

* oops

* settings read/load (incomplete)

* add `:stop` to debugger and fix detach on Windows

* settings load works

* fullscreen and aspect ratio setting fixes

* swap menu options for convenience

* settings loads automatically properly

* fix panic and font hack edge case

* add rolling, ogre, snow, swamp, sunken b, jungle b

* Fixed borderless on windows please work

* Update fake_iso.txt

* remove error from opengl debug filter

* update refs

* minor tfrag tod palette lookup change

* accidentally nuked all opengl errors
2021-12-30 18:48:37 -05:00

49 lines
1.5 KiB
C++

#pragma once
#include <array>
#include <memory>
#include "common/dma/dma_chain_read.h"
#include "game/graphics/opengl_renderer/Shader.h"
#include "game/graphics/opengl_renderer/BucketRenderer.h"
#include "game/graphics/opengl_renderer/Profiler.h"
struct RenderOptions {
int window_height_px = 0;
int window_width_px = 0;
int lbox_height_px = 0;
int lbox_width_px = 0;
bool draw_render_debug_window = false;
bool draw_profiler_window = false;
bool playing_from_dump = false;
bool save_screenshot = false;
std::string screenshot_path;
};
class OpenGLRenderer {
public:
OpenGLRenderer(std::shared_ptr<TexturePool> texture_pool);
void render(DmaFollower dma, const RenderOptions& settings);
void serialize(Serializer& ser);
private:
void setup_frame(int window_width_px, int window_height_px, int offset_x, int offset_y);
void draw_test_triangle();
void dispatch_buckets(DmaFollower dma, ScopedProfilerNode& prof);
void init_bucket_renderers();
void draw_renderer_selection_window();
void finish_screenshot(const std::string& output_name, int px, int py, int x, int y);
template <typename T, class... Args>
void init_bucket_renderer(const std::string& name, BucketId id, Args&&... args) {
m_bucket_renderers.at((int)id) = std::make_unique<T>(name, id, std::forward<Args>(args)...);
}
SharedRenderState m_render_state;
Profiler m_profiler;
std::array<std::unique_ptr<BucketRenderer>, (int)BucketId::MAX_BUCKETS> m_bucket_renderers;
};