Add a PositionTranslate func and add Errors for TextureSize mismatch
This commit is contained in:
@@ -99,6 +99,13 @@ void GfxOpenGL3::SysReset() {
|
||||
Li::Texture GfxOpenGL3::LoadTexture(const std::vector<PD::u8>& pixels, int w,
|
||||
int h, TextureFormat type,
|
||||
TextureFilter filter) {
|
||||
if (pixels.size() !=
|
||||
static_cast<size_t>(w * h * Li::TextureFormat2Bpp(type))) {
|
||||
PDERR("Failed to load Texture due to Size mismatch: {} != {}",
|
||||
pixels.size(),
|
||||
static_cast<size_t>(w * h * Li::TextureFormat2Bpp(type)));
|
||||
return Li::Texture();
|
||||
}
|
||||
GLuint texID;
|
||||
glGenTextures(1, &texID);
|
||||
glBindTexture(GL_TEXTURE_2D, texID);
|
||||
|
||||
Reference in New Issue
Block a user