summaryrefslogtreecommitdiff
path: root/tests/OffscreenContext.h
blob: f1c7123a66d06900619275489c65f5a1b1c1df6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef OFFSCREENCONTEXT_H_
#define OFFSCREENCONTEXT_H_

#ifdef Q_WS_MAC
#include <OpenGL/OpenGL.h>
#else
#include <GL/glew.h>
#include <GL/gl.h>
#endif

#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