73 lines
2.1 KiB
C++
73 lines
2.1 KiB
C++
/**
|
|
This file is a part of our_dick
|
|
Copyright (C) 2020 rexy712
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Affero General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Affero General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef OUR_DICK_GRAPHICS_OGL_WINDOW_HPP
|
|
#define OUR_DICK_GRAPHICS_OGL_WINDOW_HPP
|
|
|
|
#include "gl_include.hpp"
|
|
#include "gfx/glfw_init.hpp"
|
|
#include <rml/math.hpp>
|
|
|
|
#include "gfx/window.hpp"
|
|
|
|
#include <string>
|
|
|
|
namespace gfx::ogl{
|
|
|
|
class window : public ::gfx::window
|
|
{
|
|
private:
|
|
//opengl 4.5 has been supported since intel broadwell, nvidia 400 series, and radeon hd 5000
|
|
//should be supported on any system I care about
|
|
static constexpr int s_default_cver_maj = 4;
|
|
static constexpr int s_default_cver_min = 5;
|
|
|
|
private:
|
|
std::string m_title = {};
|
|
int m_antialias_level = 0;
|
|
int m_refresh_rate = GLFW_DONT_CARE;
|
|
int m_swap_interval = 1;
|
|
|
|
public:
|
|
window(int width, int height, const char* title, bool make_current = true);
|
|
window(int context_vmaj, int context_vmin, int width, int height, const char* title, bool make_current = true, int antialias = 0, int refresh = GLFW_DONT_CARE);
|
|
window(const window&);
|
|
window(window&&);
|
|
~window(void) = default;
|
|
|
|
window& operator=(const window&);
|
|
window& operator=(window&&);
|
|
|
|
void make_current(void);
|
|
void swap_buffers(void);
|
|
|
|
void set_antialias(int level);
|
|
void set_refresh_rate(int rate);
|
|
void set_swap_interval(int i);
|
|
void set_active(void);
|
|
|
|
rml::vec2i get_context_version(void)const;
|
|
int get_context_vmaj(void)const;
|
|
int get_context_vmin(void)const;
|
|
int get_swap_interval(void)const;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|