Removed option

This commit is contained in:
AlexandreRouma 2021-12-19 02:35:40 +01:00
parent ef01205fb6
commit fe0b63a275
2 changed files with 4 additions and 5 deletions

View File

@ -1,10 +1,9 @@
#include <gui/widgets/image.h>
namespace ImGui {
ImageDisplay::ImageDisplay(int width, int height, GLenum format) {
ImageDisplay::ImageDisplay(int width, int height) {
_width = width;
_height = height;
_format = format;
buffer = malloc(_width * _height * 4);
activeBuffer = malloc(_width * _height * 4);
memset(buffer, 0, _width * _height * 4);
@ -61,6 +60,7 @@ namespace ImGui {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, _width, _height, 0, _format, GL_UNSIGNED_BYTE, activeBuffer);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, _width, _height, 0, GL_RGBA, GL_UNSIGNED_BYTE, activeBuffer);
}
}

View File

@ -9,7 +9,7 @@
namespace ImGui {
class ImageDisplay {
public:
ImageDisplay(int width, int height, GLenum format);
ImageDisplay(int width, int height);
~ImageDisplay();
void draw(const ImVec2& size_arg = ImVec2(0, 0));
void swap();
@ -24,7 +24,6 @@ namespace ImGui {
int _width;
int _height;
GLenum _format;
GLuint textureId;