voxelcore/src/graphics/gl_util.h
2024-03-07 13:40:38 +03:00

19 lines
432 B
C++

#ifndef GRAPHICS_GL_UTIL_H_
#define GRAPHICS_GL_UTIL_H_
#include <GL/glew.h>
#include "ImageData.h"
namespace gl {
inline GLenum to_gl_format(ImageFormat imageFormat) {
switch (imageFormat) {
case ImageFormat::rgb888: return GL_RGB;
case ImageFormat::rgba8888: return GL_RGBA;
default:
return 0;
}
}
}
#endif // GRAPHICS_GL_UTIL_H_