This repository has been archived on 2022-05-21. You can view files and clone it, but cannot push or open issues or pull requests.
LEFTONE/util/gleasy/misc.h
falsycat 84c3a02b9a [RELEASE] u22-v03
This version is submitted to U22 breau.
2020-09-14 00:00:00 +00:00

19 lines
492 B
C

#pragma once
#include <GL/glew.h>
#define GLEASY_GET_BYTE_SIZE_OF_TYPE(t) ( \
(t) == GL_UNSIGNED_BYTE? 1: \
(t) == GL_BYTE? 1: \
(t) == GL_SHORT? 2: \
(t) == GL_UNSIGNED_SHORT? 2: \
(t) == GL_INT? 4: \
(t) == GL_UNSIGNED_INT? 4: \
(t) == GL_FLOAT? 4: 0)
#define GLEASY_GET_CHANNELS_OF_TEXTURE_FORMAT(f) ( \
(f) == GL_RGBA? 4: \
(f) == GL_RGB? 3: \
(f) == GL_RG? 2: \
(f) == GL_RED? 1: 0)