Initial OpenGL commit
This commit is contained in:
commit
1ae16b306f
18 changed files with 25863 additions and 0 deletions
13
include/uui/application.hpp
Normal file
13
include/uui/application.hpp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace uui
|
||||
{
|
||||
class Application
|
||||
{
|
||||
public:
|
||||
virtual void run() = 0;
|
||||
virtual void add_window(int width, int height, const std::string& title) = 0;
|
||||
};
|
||||
} // namespace uui
|
||||
43
include/uui/opengl/application.hpp
Normal file
43
include/uui/opengl/application.hpp
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "graphic_context.hpp"
|
||||
#include "uui/application.hpp"
|
||||
#include "uui/window.hpp"
|
||||
|
||||
namespace uui
|
||||
{
|
||||
|
||||
class GlWindow;
|
||||
class GlApplication: public Application
|
||||
{
|
||||
friend class GlWindow;
|
||||
|
||||
public:
|
||||
GlApplication();
|
||||
~GlApplication();
|
||||
|
||||
void run();
|
||||
void add_window(int width, int height, const std::string& title);
|
||||
|
||||
private:
|
||||
std::vector<std::unique_ptr<GlWindow>> windows;
|
||||
};
|
||||
|
||||
class GlWindow: public Window
|
||||
{
|
||||
friend class GlApplication;
|
||||
|
||||
public:
|
||||
GlWindow(const GlApplication& app, int width, int height, const std::string& title);
|
||||
~GlWindow();
|
||||
|
||||
private:
|
||||
const GlApplication& app;
|
||||
|
||||
void draw();
|
||||
};
|
||||
|
||||
} // namespace uui
|
||||
3
include/uui/opengl/window.hpp
Normal file
3
include/uui/opengl/window.hpp
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
#include "uui/opengl/application.hpp"
|
||||
9
include/uui/shader.hpp
Normal file
9
include/uui/shader.hpp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace uui
|
||||
{
|
||||
std::vector<char> readFile(const std::string& filename);
|
||||
}
|
||||
22
include/uui/window.hpp
Normal file
22
include/uui/window.hpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
#include "graphic_context.hpp"
|
||||
|
||||
class Window
|
||||
{
|
||||
public:
|
||||
std::string title;
|
||||
|
||||
virtual void draw() = 0;
|
||||
|
||||
protected:
|
||||
GLFWwindow* glfw_window;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue