Skip to content
Snippets Groups Projects
Commit fee3b753 authored by marco's avatar marco
Browse files

fix compilation on Mac caused by OffscreenBuffer refactoring

Potentially also fixes compilation on Win32

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2036 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 109209c6
Branches
Tags
No related merge requests found
......@@ -28,10 +28,10 @@
namespace ost { namespace gfx {
OffscreenBuffer::OffscreenBuffer(unsigned int width, unsigned int height, const OffscreenBufferFormat& f, bool shared):
OffscreenBuffer::OffscreenBuffer(unsigned int width, unsigned int height,
const OffscreenBufferFormat& f, bool shared):
width_(width), height_(height), valid_(false), active_(false)
{
#if 0
CGLPixelFormatAttribute attributes[]={
kCGLPFAPBuffer,
kCGLPFAColorSize, CGLPixelFormatAttribute(f.cbits),
......@@ -48,10 +48,11 @@ OffscreenBuffer::OffscreenBuffer(unsigned int width, unsigned int height, const
}
// if a context exists, share resources such as shader programs and display
// lists.
// TODO: honor if shared?
err=CGLCreateContext(pix_format_, CGLGetCurrentContext(), &context_);
if (shared) {
err=CGLCreateContext(pix_format_, CGLGetCurrentContext(), &context_);
} else {
err=CGLCreateContext(pix_format, NULL, &context_);
}
if(err) {
LOGN_ERROR("error creating offscreen rendering context. "
"CGLCreateContext failed" << CGLErrorString(err));
......@@ -73,14 +74,11 @@ OffscreenBuffer::OffscreenBuffer(unsigned int width, unsigned int height, const
return;
}
valid_=true;
#endif
}
bool OffscreenBuffer::Resize(unsigned int w, unsigned int h)
bool OffscreenBuffer::Resize(unsigned int width, unsigned int height)
{
#if 0
CGLPBufferObj new_pbuffer;
CGLError err=CGLCreatePBuffer(width, height, GL_TEXTURE_RECTANGLE_EXT,
GL_RGBA, 0, &new_pbuffer);
......@@ -106,14 +104,11 @@ bool OffscreenBuffer::Resize(unsigned int w, unsigned int h)
width_=width;
height_=height;
#else
return false;
#endif
return true;
}
bool OffscreenBuffer::MakeActive()
{
#if 0
if(active_) return true;
if (CGLError err=CGLSetCurrentContext(context_)) {
......@@ -122,10 +117,6 @@ bool OffscreenBuffer::MakeActive()
return false;
}
return true;
#else
return false;
#endif
}
}} // ns
......@@ -29,10 +29,11 @@ namespace ost { namespace gfx {
Author: Marco Biasini
*/
class CGLOffscreenBuffer
class OffscreenBuffer
{
public:
CGLOffscreenBuffer(unsigned int width, unsigned int height, const OffscreenBufferFormat& f, bool shared=true);
OffscreenBuffer(unsigned int width, unsigned int height,
const OffscreenBufferFormat& f, bool shared=true);
bool Resize(unsigned int w, unsigned int h);
......
......@@ -21,12 +21,12 @@
namespace ost { namespace gfx {
WGLOffscreenBuffer::WGLOffscreenBuffer(unsigned int width, unsigned int height, const OffscreenBufferFormat& f, bool shared=true):
OffscreenBuffer::OffscreenBuffer(unsigned int width, unsigned int height, const OffscreenBufferFormat& f, bool shared=true):
width_(width), height_(height), valid_(false), active_(false)
{}
bool WGLOffscreenBuffer::Resize(unsigned int w, unsigned int h) {return false;}
bool OffscreenBuffer::Resize(unsigned int w, unsigned int h) {return false;}
bool WGLOffscreenBuffer::MakeActive() {return false;}
bool OffscreenBuffer::MakeActive() {return false;}
}} // ns
......@@ -27,10 +27,11 @@ namespace ost { namespace gfx {
wgl implementation for offscreen buffers
*/
class WGLOffscreenBuffer: public OffscreenBuffer
class OffscreenBuffer
{
public:
WGLOffscreenBuffer(unsigned int width, unsigned int height, const OffscreenBufferFormat& f, bool shared=true);
OffscreenBuffer(unsigned int width, unsigned int height,
const OffscreenBufferFormat& f, bool shared=true);
bool Resize(unsigned int w, unsigned int h);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment