-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/origin/master' into release
Conflicts: include/version.h
- Loading branch information
Showing
6 changed files
with
61 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,3 @@ | ||
/************************************************************************************************** | ||
* THE OMEGA LIB PROJECT | ||
*------------------------------------------------------------------------------------------------- | ||
* Copyright 2010-2015 Electronic Visualization Laboratory, University of Illinois at Chicago | ||
* Authors: | ||
* Alessandro Febretti [email protected] | ||
*------------------------------------------------------------------------------------------------- | ||
* Copyright (c) 2010-2015, Electronic Visualization Laboratory, University of Illinois at Chicago | ||
* All rights reserved. | ||
* Redistribution and use in source and binary forms, with or without modification, are permitted | ||
* provided that the following conditions are met: | ||
* | ||
* Redistributions of source code must retain the above copyright notice, this list of conditions | ||
* and the following disclaimer. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the documentation and/or other | ||
* materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR | ||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*************************************************************************************************/ | ||
/****************************************************************************** | ||
* THE OMEGA LIB PROJECT | ||
*----------------------------------------------------------------------------- | ||
|
@@ -82,44 +56,50 @@ typedef struct GLEWContextStruct GLEWContext; | |
|
||
namespace omega | ||
{ | ||
/////////////////////////////////////////////////////////////////////////////////////////////// | ||
class OMEGA_API GpuContext: public ReferenceType | ||
{ | ||
public: | ||
static const unsigned int MaxContexts = 64; | ||
enum TextureUnit { | ||
TextureUnitInvalid = 0, | ||
TextureUnit0 = GL_TEXTURE0, | ||
TextureUnit1 = GL_TEXTURE1, | ||
TextureUnit2 = GL_TEXTURE2, | ||
TextureUnit3 = GL_TEXTURE3 }; | ||
/////////////////////////////////////////////////////////////////////////// | ||
class OMEGA_API GpuContext: public ReferenceType | ||
{ | ||
public: | ||
static const unsigned int MaxContexts = 64; | ||
enum TextureUnit { | ||
TextureUnitInvalid = 0, | ||
TextureUnit0 = GL_TEXTURE0, | ||
TextureUnit1 = GL_TEXTURE1, | ||
TextureUnit2 = GL_TEXTURE2, | ||
TextureUnit3 = GL_TEXTURE3 }; | ||
|
||
GpuContext(bool initializeGlew = true); | ||
~GpuContext(); | ||
//! Initializes a GPU context. If the passed GLEW context is null, | ||
//! a glew context will be created internally and GLEW will be | ||
//! initialized by this contstructor. | ||
//! @remarks This method needs to be called from within a valid OpenGL | ||
//! context. | ||
GpuContext(GLEWContext* ctx = NULL); | ||
~GpuContext(); | ||
|
||
uint getId() { return myId; } | ||
GLEWContext* getGlewContext() { return myGlewContext; } | ||
uint getId() { return myId; } | ||
GLEWContext* getGlewContext() { return myGlewContext; } | ||
void makeCurrent(); | ||
//void setGlewContext(GLEWContext* ctx) { myGlewContext = ctx; } | ||
|
||
private: | ||
static uint mysNumContexts; | ||
static Lock mysContextLock; | ||
private: | ||
static uint mysNumContexts; | ||
static Lock mysContextLock; | ||
|
||
uint myId; | ||
GLEWContext* myGlewContext; | ||
}; | ||
uint myId; | ||
GLEWContext* myGlewContext; | ||
bool myOwnGlewContext; | ||
}; | ||
|
||
/////////////////////////////////////////////////////////////////////////////////////////////// | ||
class OMEGA_API GpuResource: public ReferenceType | ||
{ | ||
public: | ||
GpuResource(GpuContext* ctx): myContext(ctx) { } | ||
GpuContext* getContext() { return myContext; } | ||
virtual void dispose() = 0; | ||
private: | ||
GpuContext* myContext; | ||
}; | ||
/////////////////////////////////////////////////////////////////////////////////////////////// | ||
class OMEGA_API GpuResource: public ReferenceType | ||
{ | ||
public: | ||
GpuResource(GpuContext* ctx): myContext(ctx) { } | ||
GpuContext* getContext() { return myContext; } | ||
virtual void dispose() = 0; | ||
private: | ||
GpuContext* myContext; | ||
}; | ||
}; // namespace omega | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters