mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-09 07:35:41 +12:00
[OpenGL HAL] Add createDSTexture
This commit is contained in:
parent
f9669ce79c
commit
d79fd1e198
1 changed files with 12 additions and 0 deletions
|
@ -193,6 +193,18 @@ namespace OpenGL {
|
||||||
create(width, height, internalFormat, GL_TEXTURE_2D_MULTISAMPLE, samples);
|
create(width, height, internalFormat, GL_TEXTURE_2D_MULTISAMPLE, samples);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Creates a depth, stencil or depth-stencil texture
|
||||||
|
void createDSTexture(int width, int height, GLenum internalFormat, GLenum format, const void* data = nullptr,
|
||||||
|
GLenum type = GL_FLOAT, GLenum binding = GL_TEXTURE_2D) {
|
||||||
|
m_width = width;
|
||||||
|
m_height = height;
|
||||||
|
m_binding = binding;
|
||||||
|
|
||||||
|
glGenTextures(1, &m_handle);
|
||||||
|
bind();
|
||||||
|
glTexImage2D(binding, 0, internalFormat, width, height, 0, format, type, data);
|
||||||
|
}
|
||||||
|
|
||||||
void setWrapS(WrappingMode mode) {
|
void setWrapS(WrappingMode mode) {
|
||||||
glTexParameteri(m_binding, GL_TEXTURE_WRAP_S, static_cast<GLint>(mode));
|
glTexParameteri(m_binding, GL_TEXTURE_WRAP_S, static_cast<GLint>(mode));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue