12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #include "wrapper/TextureFormat.h"
- TextureFormat::TextureFormat(GLint internalformat, GLenum format, GLenum type, bool depth) :
- internalformat(internalformat), format(format), type(type), depth(depth) {
- }
- TextureFormat TextureFormat::color1() {
- return TextureFormat(GL_RED, GL_RED, GL_UNSIGNED_BYTE);
- }
- TextureFormat TextureFormat::color2() {
- return TextureFormat(GL_RG, GL_RG, GL_UNSIGNED_BYTE);
- }
- TextureFormat TextureFormat::color3() {
- return TextureFormat(GL_RGB, GL_RGB, GL_UNSIGNED_BYTE);
- }
- TextureFormat TextureFormat::color4() {
- return TextureFormat(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE);
- }
- TextureFormat TextureFormat::float16() {
- return TextureFormat(GL_R16F, GL_RED, GL_FLOAT);
- }
- TextureFormat TextureFormat::float32() {
- return TextureFormat(GL_R32F, GL_RED, GL_FLOAT);
- }
- TextureFormat TextureFormat::float16Vector2() {
- return TextureFormat(GL_RG16F, GL_RG, GL_FLOAT);
- }
- TextureFormat TextureFormat::float16Vector3() {
- return TextureFormat(GL_RGB16F, GL_RGB, GL_FLOAT);
- }
- TextureFormat TextureFormat::float16Vector4() {
- return TextureFormat(GL_RGBA16F, GL_RGBA, GL_FLOAT);
- }
- TextureFormat TextureFormat::float32Vector2() {
- return TextureFormat(GL_RG32F, GL_RG, GL_FLOAT);
- }
- TextureFormat TextureFormat::float32Vector3() {
- return TextureFormat(GL_RGB32F, GL_RGB, GL_FLOAT);
- }
- TextureFormat TextureFormat::float32Vector4() {
- return TextureFormat(GL_RGBA32F, GL_RGBA, GL_FLOAT);
- }
- TextureFormat TextureFormat::depth16() {
- return TextureFormat(GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_FLOAT, true);
- }
- TextureFormat TextureFormat::depth32() {
- return TextureFormat(GL_DEPTH_COMPONENT32, GL_DEPTH_COMPONENT, GL_FLOAT, true);
- }
|