diff options
author | Marius Kintel <marius@kintel.net> | 2011-12-07 20:36:29 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-12-07 20:36:29 (GMT) |
commit | 2e3ea0a64fe4b098bf09c6c09fcf3f63a4849d18 (patch) | |
tree | 4b9bf56f11d35d565e4b8f2061d92ec1cd2f7a0a /tests/OffscreenContext.mm | |
parent | 577359073769db76d174284f490de96046abb428 (diff) | |
parent | faae7882e26c048b0ae2bf7a54065d31d0edbc31 (diff) |
Merge branch 'cakebaby' of https://github.com/donbright/openscad into donbright-cakebaby
Diffstat (limited to 'tests/OffscreenContext.mm')
-rw-r--r-- | tests/OffscreenContext.mm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/OffscreenContext.mm b/tests/OffscreenContext.mm index 0c44d7d..eb06615 100644 --- a/tests/OffscreenContext.mm +++ b/tests/OffscreenContext.mm @@ -17,6 +17,15 @@ struct OffscreenContext fbo_t *fbo; }; +string offscreen_context_getinfo(OffscreenContext *ctx) +{ + stringstream out; + out << "GL context creator: Cocoa / CGL\n" + << "PNG generator: Core Foundation\n" + << "OS info: Mac OSX\n" + << "Machine: Apple(TM) Mac(TM)\n"; + return out.str(); +} OffscreenContext *create_offscreen_context(int w, int h) { @@ -84,6 +93,7 @@ bool teardown_offscreen_context(OffscreenContext *ctx) */ bool save_framebuffer(OffscreenContext *ctx, const char *filename) { + if (!ctx || !filename) return false; // Read pixels from OpenGL int samplesPerPixel = 4; // R, G, B and A int rowBytes = samplesPerPixel * ctx->width; |