OpenUT99-Plus
Unreal Engine 1, rebuilt from scratch
Loading...
Searching...
No Matches
render.h
Go to the documentation of this file.
1// OpenGL 3.3 renderer for the map viewer. Needs a current GL context.
2#pragma once
3#include <memory>
4#include <string>
5
6#include "scene.h"
7
8namespace ut {
9
10struct Camera {
12 float yaw = 0, pitch = 0; // radians; yaw from +X towards +Y, pitch up
13 float fov = 90; // horizontal, degrees (UT default)
14};
15
16class Renderer {
17public:
18 explicit Renderer(const Scene& scene); // uploads all batches
19 ~Renderer();
20 void draw(const Camera& cam, int w, int h, const std::vector<LiveBatch>& live = {}); // live: uploaded each call
21 void crosshair(int w, int h); // a small white cross in the middle, over the last draw
22 void save_png(const std::string& path, int w, int h) const;
23
24private:
25 struct Impl;
26 std::unique_ptr<Impl> p_;
27};
28
29} // namespace ut
~Renderer()
Definition render.cpp:136
void draw(const Camera &cam, int w, int h, const std::vector< LiveBatch > &live={})
Definition render.cpp:167
void save_png(const std::string &path, int w, int h) const
Definition render.cpp:239
void crosshair(int w, int h)
Definition render.cpp:229
Renderer(const Scene &scene)
Definition render.cpp:96
Definition collision.cpp:7
Definition render.h:10
float fov
Definition render.h:13
float yaw
Definition render.h:12
Vec3 pos
Definition render.h:11
float pitch
Definition render.h:12
Definition render.cpp:44
Definition scene.h:33
Definition upkg.h:66