mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-20 10:25:40 +00:00
Initial commit of current work on Prime World Editor
This commit is contained in:
41
OpenGL/CGL.cpp
Normal file
41
OpenGL/CGL.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#include "CGL.h"
|
||||
|
||||
// ************ PUBLIC ************
|
||||
void CGL::SetBlendMode(EBlendFactor Source, EBlendFactor Dest)
|
||||
{
|
||||
glBlendFuncSeparate(Source, Dest, eBlendZero, eBlendZero);
|
||||
mBlendSrcFac = Source;
|
||||
mBlendDstFac = Dest;
|
||||
}
|
||||
|
||||
void CGL::SetOpaqueBlend()
|
||||
{
|
||||
SetBlendMode(eBlendOne, eBlendZero);
|
||||
}
|
||||
|
||||
void CGL::SetAlphaBlend()
|
||||
{
|
||||
SetBlendMode(eBlendSrcAlpha, eBlendInvSrcAlpha);
|
||||
}
|
||||
|
||||
void CGL::SetAdditiveBlend()
|
||||
{
|
||||
SetBlendMode(eBlendOne, eBlendOne);
|
||||
}
|
||||
|
||||
// ************ PRIVATE ************
|
||||
void CGL::Init()
|
||||
{
|
||||
if (!mInitialized)
|
||||
{
|
||||
glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ZERO, GL_ZERO);
|
||||
mBlendSrcFac = eBlendOne;
|
||||
mBlendDstFac = eBlendZero;
|
||||
mInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
// ************ STATIC MEMBER INITIALIZATION ************
|
||||
bool CGL::mInitialized;
|
||||
EBlendFactor CGL::mBlendSrcFac;
|
||||
EBlendFactor CGL::mBlendDstFac;
|
||||
Reference in New Issue
Block a user