Files
libreoffice/vcl/inc/opengl/framebuffer.hxx
Michael Meeks b27b9084c5 tdf#93772 - handle framebuffer unbinding on GL context switch.
Also start gl tests in vcldemo:
    $ SAL_FORCEGL=1 vcldemo --gltests

Change-Id: I8f0022770d57cd60c830659e3f7fcc0721320a10
Reviewed-on: https://gerrit.libreoffice.org/18132
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-08-31 19:48:14 +00:00

50 lines
1.3 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_VCL_INC_OPENGL_FRAMEBUFFER_H
#define INCLUDED_VCL_INC_OPENGL_FRAMEBUFFER_H
#include <GL/glew.h>
#include <vcl/dllapi.h>
#include <opengl/texture.hxx>
class VCL_DLLPUBLIC OpenGLFramebuffer
{
private:
GLuint mnId;
int mnWidth;
int mnHeight;
GLuint mnAttachedTexture;
public:
OpenGLFramebuffer();
virtual ~OpenGLFramebuffer();
int GetWidth() const { return mnWidth; };
int GetHeight() const { return mnHeight; };
void Bind();
static void Unbind();
bool IsFree() const;
bool IsAttached( GLuint nTexture ) const;
bool IsAttached( const OpenGLTexture& rTexture ) const;
void AttachTexture( const OpenGLTexture& rTexture );
void DetachTexture();
public:
OpenGLFramebuffer* mpPrevFramebuffer;
OpenGLFramebuffer* mpNextFramebuffer;
};
#endif // INCLUDED_VCL_INC_OPENGL_FRAMEBUFFER_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */