Procházet zdrojové kódy

remove GlTexture

feature/replace-renderer
Martin Dørum před 3 roky
rodič
revize
f971f448c8

+ 0
- 16
libcygnet/include/cygnet/GlWrappers.h Zobrazit soubor

@@ -59,20 +59,4 @@ private:
GLuint id_;
};

class GlTexture {
public:
GlTexture();

void upload(GLsizei width, GLsizei height, void *data,
GLenum format, GLenum type);
GLuint id() { return id_; }
int width() { return w_; }
int height() { return h_; }

private:
GLuint id_;
int w_;
int h_;
};

}

+ 0
- 18
libcygnet/src/GlWrappers.cc Zobrazit soubor

@@ -93,22 +93,4 @@ void GlProgram::link() {
}
}

GlTexture::GlTexture() {
glGenTextures(1, &id_);
glCheck();
}

void GlTexture::upload(GLsizei width, GLsizei height, void *data,
GLenum format, GLenum type) {
w_ = width;
h_ = height;
glBindTexture(GL_TEXTURE_2D, id_);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, format, type, data);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glCheck();
}

}

Načítá se…
Zrušit
Uložit