summaryrefslogtreecommitdiff
path: root/tests/OffscreenContext.h
blob: 0300bcb23447f57e57c4c49824e11b7464905c1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef OFFSCREENCONTEXT_H_
#define OFFSCREENCONTEXT_H_

#include <OpenGL/OpenGL.h>
#include <iostream>         // for error output

#define REPORTGLERROR(task) { GLenum tGLErr = glGetError(); if (tGLErr != GL_NO_ERROR) { std::cout << "OpenGL error " << tGLErr << " while " << task << "\n"; } }

struct OffscreenContext *create_offscreen_context(int w, int h);
void bind_offscreen_context(OffscreenContext *ctx);
bool teardown_offscreen_context(OffscreenContext *ctx);
bool save_framebuffer(OffscreenContext *ctx, const char *filename);

#endif
contact: Jan Huwald // Impressum