viewport.h
#ifndef CSD462_VIEWPORT_H
#define CSD462_VIEWPORT_H
#include "glew.h"
namespace CSD462 {
class Viewport {
public:
Viewport( void );
~Viewport( void );
int bind( char *buffer, size_t w, size_t h );
void update( void );
private:
size_t w, h;
void *pixels;
GLuint vertex_buffer;
GLuint uv_buffer;
GLuint texture;
GLuint textureID;
GLuint program;
GLuint compile_shaders( void );
GLuint make_buffer( GLenum target,
GLsizei buffer_size,
const void *buffer_data );
GLuint make_texture_rgb( void* pixel_buffer,
unsigned int width,
unsigned int height );
GLuint make_texture_rgba( void* pixel_buffer,
unsigned int width,
unsigned int height );
void update_texture_rgb( GLuint textureID,
void* pixel_buffer,
unsigned int width,
unsigned int height );
void update_texture_rgba( GLuint textureID,
void* pixel_buffer,
unsigned int width,
unsigned int height );
};
}; // namespace CSD462
#endif // CSD462_VIEWPORT_H
CSD462::Viewport::Viewport
Viewport(void)
Constructor.
Definition: viewport.cpp:8
CSD462::Viewport::update
void update(void)
Update the viewport.
Definition: viewport.cpp:69
CSD462::Viewport
Draws buffered image data as texture.
Definition: viewport.h:14
CSD462::Viewport::~Viewport
~Viewport(void)
Destructor.
Definition: viewport.cpp:48
CSD462::Viewport::bind
int bind(char *buffer, size_t w, size_t h)
Bind the viewport to a bitmap buffer.
Definition: viewport.cpp:58
CSD462
Definition: color.cpp:10