UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
dxt_util.h
Go to the documentation of this file.
1
27#ifndef DXT_UTIL_H
28#define DXT_UTIL_H
29
30#ifdef HAVE_CONFIG_H
31#include "config.h"
32#include "config_unix.h"
33#include "config_win32.h"
34#endif
35
36#include "dxt_common.h"
37
38#ifdef HAVE_MACOSX
39#include <OpenGL/gl.h>
40#include <OpenGL/glext.h>
41#elif defined WIN32
42#include <GL/glew.h>
43#else
44#include <GL/glew.h>
45#include <GL/gl.h>
46#endif
47
48#include <string.h>
49
50#ifdef HAVE_GLUT
51#ifdef HAVE_MACOSX
52#include <GLUT/glut.h>
53extern void glutCheckLoop(void);
54#else
55#include <GL/glut.h>
56extern void glutMainLoopEvent(void);
57#endif /* HAVE_MACOSX */
58#endif /* HAVE_GLUT */
59
60static inline int dxt_get_size(int width, int height, enum dxt_type format)
61{
62 assert( format == DXT_TYPE_DXT5_YCOCG || format == DXT_TYPE_DXT1 || format == DXT_TYPE_DXT1_YUV );
63
64 if ( format == DXT_TYPE_DXT5_YCOCG )
65 return ((width + 3) / 4 * 4) * ((height + 3) / 4 * 4);
66 else
67 return ((width + 3) / 4 * 4) * ((height + 3) / 4 * 4) / 2;
68}
69
77GLuint
78dxt_shader_create_from_source(const char* source, GLenum type);
79
87GLuint
88dxt_shader_create_from_file(const char* filename, GLenum type);
89
90
91
92#endif // DXT_UTIL_H
dxt_type
Definition dxt_common.h:88
@ DXT_TYPE_DXT1_YUV
Definition dxt_common.h:90
@ DXT_TYPE_DXT1
Definition dxt_common.h:89
@ DXT_TYPE_DXT5_YCOCG
Definition dxt_common.h:91
GLuint dxt_shader_create_from_file(const char *filename, GLenum type)
Definition dxt_util.c:56
GLuint dxt_shader_create_from_source(const char *source, GLenum type)
Definition dxt_util.c:32
static int dxt_get_size(int width, int height, enum dxt_type format)
Definition dxt_util.h:60
Option::OptType type
Definition settings.cpp:194
Definition rtp.c:206