mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 15:20:05 +00:00
Use GLEW instead of QOpenGLFunctions
This commit is contained in:
parent
4bd749d976
commit
331b2d855f
33 changed files with 788 additions and 959 deletions
|
|
@ -314,7 +314,7 @@ void TextureAtlas::BuildAtlas(std::size_t width, std::size_t height)
|
|||
logger_->debug("Texture atlas built in {}", timer.format(6, "%ws"));
|
||||
}
|
||||
|
||||
void TextureAtlas::BufferAtlas(gl::OpenGLFunctions& gl, GLuint texture)
|
||||
void TextureAtlas::BufferAtlas(GLuint texture)
|
||||
{
|
||||
std::shared_lock lock(p->atlasMutex_);
|
||||
|
||||
|
|
@ -343,25 +343,23 @@ void TextureAtlas::BufferAtlas(gl::OpenGLFunctions& gl, GLuint texture)
|
|||
|
||||
lock.unlock();
|
||||
|
||||
gl.glBindTexture(GL_TEXTURE_2D_ARRAY, texture);
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY, texture);
|
||||
|
||||
gl.glTexParameteri(
|
||||
GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
gl.glTexParameteri(
|
||||
GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
gl.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
gl.glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
||||
gl.glTexImage3D(GL_TEXTURE_2D_ARRAY,
|
||||
0,
|
||||
GL_RGBA,
|
||||
static_cast<GLsizei>(width),
|
||||
static_cast<GLsizei>(height),
|
||||
static_cast<GLsizei>(numLayers),
|
||||
0,
|
||||
GL_RGBA,
|
||||
GL_UNSIGNED_BYTE,
|
||||
pixelData.data());
|
||||
glTexImage3D(GL_TEXTURE_2D_ARRAY,
|
||||
0,
|
||||
GL_RGBA,
|
||||
static_cast<GLsizei>(width),
|
||||
static_cast<GLsizei>(height),
|
||||
static_cast<GLsizei>(numLayers),
|
||||
0,
|
||||
GL_RGBA,
|
||||
GL_UNSIGNED_BYTE,
|
||||
pixelData.data());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public:
|
|||
std::shared_ptr<boost::gil::rgba8_image_t> CacheTexture(
|
||||
const std::string& name, const std::string& path, double scale = 1);
|
||||
void BuildAtlas(std::size_t width, std::size_t height);
|
||||
void BufferAtlas(gl::OpenGLFunctions& gl, GLuint texture);
|
||||
void BufferAtlas(GLuint texture);
|
||||
|
||||
TextureAttributes GetTextureAttributes(const std::string& name);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue