16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 17:09:19 +02:00

multisampling

This commit is contained in:
milek7
2018-07-13 00:32:25 +02:00
parent c94820e8b7
commit 0acf2da5c1
10 changed files with 96 additions and 52 deletions

View File

@@ -41,7 +41,7 @@ struct opengl_texture {
height() const {
return data_height; }
void alloc_rendertarget(GLint format, GLint components, GLint type, int width, int height);
void alloc_rendertarget(GLint format, GLint components, GLint type, int width, int height, int samples = 1);
// members
GLuint id{ (GLuint)-1 }; // associated GL resource
@@ -51,6 +51,8 @@ struct opengl_texture {
std::string name; // name of the texture source file
std::size_t size{ 0 }; // size of the texture data, in kb
GLenum target = GL_TEXTURE_2D;
private:
// methods
void load_BMP();
@@ -64,6 +66,8 @@ private:
// members
bool is_rendertarget; // is used as postfx rendertarget, without loaded data
int samples;
std::vector<char> data; // texture data (stored GL-style, bottom-left origin)
resource_state data_state{ resource_state::none }; // current state of texture data
int data_width{ 0 },