Cleanup & refactoring

This commit is contained in:
Aruki
2018-12-16 14:00:40 -07:00
parent 2287b05bc3
commit c4829f5fda
197 changed files with 2461 additions and 2345 deletions

View File

@@ -6,8 +6,8 @@ static const uint32 gskAttribSize[] = {
};
CDynamicVertexBuffer::CDynamicVertexBuffer()
: mAttribFlags(eNoAttributes)
, mBufferedFlags(eNoAttributes)
: mAttribFlags(EVertexAttribute::None)
, mBufferedFlags(EVertexAttribute::None)
, mNumVertices(0)
{
}
@@ -48,19 +48,19 @@ void CDynamicVertexBuffer::BufferAttrib(EVertexAttribute Attrib, const void *pkD
switch (Attrib)
{
case ePosition: Index = 0; break;
case eNormal: Index = 1; break;
case eColor0: Index = 2; break;
case eColor1: Index = 3; break;
case eTex0: Index = 4; break;
case eTex1: Index = 5; break;
case eTex2: Index = 6; break;
case eTex3: Index = 7; break;
case eTex4: Index = 8; break;
case eTex5: Index = 9; break;
case eTex6: Index = 10; break;
case eTex7: Index = 11; break;
default: return;
case EVertexAttribute::Position: Index = 0; break;
case EVertexAttribute::Normal: Index = 1; break;
case EVertexAttribute::Color0: Index = 2; break;
case EVertexAttribute::Color1: Index = 3; break;
case EVertexAttribute::Tex0: Index = 4; break;
case EVertexAttribute::Tex1: Index = 5; break;
case EVertexAttribute::Tex2: Index = 6; break;
case EVertexAttribute::Tex3: Index = 7; break;
case EVertexAttribute::Tex4: Index = 8; break;
case EVertexAttribute::Tex5: Index = 9; break;
case EVertexAttribute::Tex6: Index = 10; break;
case EVertexAttribute::Tex7: Index = 11; break;
default: return;
}
glBindBuffer(GL_ARRAY_BUFFER, mAttribBuffers[Index]);
@@ -77,7 +77,7 @@ void CDynamicVertexBuffer::ClearBuffers()
glDeleteBuffers(1, &mAttribBuffers[iAttrib]);
}
mBufferedFlags = eNoAttributes;
mBufferedFlags = EVertexAttribute::None;
}
GLuint CDynamicVertexBuffer::CreateVAO()

View File

@@ -155,29 +155,29 @@ bool CShaderGenerator::CreateVertexShader(const CMaterial& rkMat)
// Input
ShaderCode << "// Input\n";
FVertexDescription VtxDesc = rkMat.VtxDesc();
ASSERT(VtxDesc & ePosition);
ASSERT(VtxDesc & EVertexAttribute::Position);
ShaderCode << "layout(location = 0) in vec3 RawPosition;\n";
if (VtxDesc & eNormal) ShaderCode << "layout(location = 1) in vec3 RawNormal;\n";
if (VtxDesc & eColor0) ShaderCode << "layout(location = 2) in vec4 RawColor0;\n";
if (VtxDesc & eColor1) ShaderCode << "layout(location = 3) in vec4 RawColor1;\n";
if (VtxDesc & eTex0) ShaderCode << "layout(location = 4) in vec2 RawTex0;\n";
if (VtxDesc & eTex1) ShaderCode << "layout(location = 5) in vec2 RawTex1;\n";
if (VtxDesc & eTex2) ShaderCode << "layout(location = 6) in vec2 RawTex2;\n";
if (VtxDesc & eTex3) ShaderCode << "layout(location = 7) in vec2 RawTex3;\n";
if (VtxDesc & eTex4) ShaderCode << "layout(location = 8) in vec2 RawTex4;\n";
if (VtxDesc & eTex5) ShaderCode << "layout(location = 9) in vec2 RawTex5;\n";
if (VtxDesc & eTex6) ShaderCode << "layout(location = 10) in vec2 RawTex6;\n";
if (VtxDesc & eTex7) ShaderCode << "layout(location = 11) in vec2 RawTex7;\n";
if (VtxDesc & eBoneIndices) ShaderCode << "layout(location = 12) in int BoneIndices;\n";
if (VtxDesc & eBoneWeights) ShaderCode << "layout(location = 13) in vec4 BoneWeights;\n";
ShaderCode << "layout(location = 0) in vec3 RawPosition;\n";
if (VtxDesc & EVertexAttribute::Normal) ShaderCode << "layout(location = 1) in vec3 RawNormal;\n";
if (VtxDesc & EVertexAttribute::Color0) ShaderCode << "layout(location = 2) in vec4 RawColor0;\n";
if (VtxDesc & EVertexAttribute::Color1) ShaderCode << "layout(location = 3) in vec4 RawColor1;\n";
if (VtxDesc & EVertexAttribute::Tex0) ShaderCode << "layout(location = 4) in vec2 RawTex0;\n";
if (VtxDesc & EVertexAttribute::Tex1) ShaderCode << "layout(location = 5) in vec2 RawTex1;\n";
if (VtxDesc & EVertexAttribute::Tex2) ShaderCode << "layout(location = 6) in vec2 RawTex2;\n";
if (VtxDesc & EVertexAttribute::Tex3) ShaderCode << "layout(location = 7) in vec2 RawTex3;\n";
if (VtxDesc & EVertexAttribute::Tex4) ShaderCode << "layout(location = 8) in vec2 RawTex4;\n";
if (VtxDesc & EVertexAttribute::Tex5) ShaderCode << "layout(location = 9) in vec2 RawTex5;\n";
if (VtxDesc & EVertexAttribute::Tex6) ShaderCode << "layout(location = 10) in vec2 RawTex6;\n";
if (VtxDesc & EVertexAttribute::Tex7) ShaderCode << "layout(location = 11) in vec2 RawTex7;\n";
if (VtxDesc & EVertexAttribute::BoneIndices) ShaderCode << "layout(location = 12) in int BoneIndices;\n";
if (VtxDesc & EVertexAttribute::BoneWeights) ShaderCode << "layout(location = 13) in vec4 BoneWeights;\n";
ShaderCode << "\n";
// Output
ShaderCode << "// Output\n";
if (VtxDesc & eNormal) ShaderCode << "out vec3 Normal;\n";
if (VtxDesc & eColor0) ShaderCode << "out vec4 Color0;\n";
if (VtxDesc & eColor1) ShaderCode << "out vec4 Color1;\n";
if (VtxDesc & EVertexAttribute::Normal) ShaderCode << "out vec3 Normal;\n";
if (VtxDesc & EVertexAttribute::Color0) ShaderCode << "out vec4 Color0;\n";
if (VtxDesc & EVertexAttribute::Color1) ShaderCode << "out vec4 Color1;\n";
for (uint32 iPass = 0; iPass < rkMat.PassCount(); iPass++)
if (rkMat.Pass(iPass)->TexCoordSource() != 0xFF)
@@ -222,7 +222,7 @@ bool CShaderGenerator::CreateVertexShader(const CMaterial& rkMat)
<< "uniform int NumLights;\n"
<< "\n";
bool HasSkinning = (rkMat.VtxDesc().HasAnyFlags(eBoneIndices | eBoneWeights));
bool HasSkinning = (rkMat.VtxDesc().HasAnyFlags(EVertexAttribute::BoneIndices | EVertexAttribute::BoneWeights));
if (HasSkinning)
{
@@ -240,8 +240,8 @@ bool CShaderGenerator::CreateVertexShader(const CMaterial& rkMat)
<< " mat4 MV = ModelMtx * ViewMtx;\n"
<< " mat4 MVP = MV * ProjMtx;\n";
if (VtxDesc & eColor0) ShaderCode << " Color0 = RawColor0;\n";
if (VtxDesc & eColor1) ShaderCode << " Color1 = RawColor1;\n";
if (VtxDesc & EVertexAttribute::Color0) ShaderCode << " Color0 = RawColor0;\n";
if (VtxDesc & EVertexAttribute::Color1) ShaderCode << " Color1 = RawColor1;\n";
ShaderCode << "\n";
// Skinning
@@ -250,7 +250,7 @@ bool CShaderGenerator::CreateVertexShader(const CMaterial& rkMat)
ShaderCode << " // Skinning\n"
<< " vec3 ModelSpacePos = vec3(0,0,0);\n";
if (VtxDesc & eNormal)
if (VtxDesc & EVertexAttribute::Normal)
ShaderCode << " vec3 ModelSpaceNormal = vec3(0,0,0);\n";
ShaderCode << " \n"
@@ -264,14 +264,14 @@ bool CShaderGenerator::CreateVertexShader(const CMaterial& rkMat)
<< " {\n"
<< " ModelSpacePos += vec3(vec4(RawPosition, 1) * BoneTransforms[BoneIdx] * Weight);\n";
if (VtxDesc & eNormal)
if (VtxDesc & EVertexAttribute::Normal)
ShaderCode << " ModelSpaceNormal += RawNormal.xyz * inverse(transpose(mat3(BoneTransforms[BoneIdx]))) * Weight;\n";
ShaderCode << " }\n"
<< " }\n"
<< " \n";
if (VtxDesc & eNormal)
if (VtxDesc & EVertexAttribute::Normal)
ShaderCode << " ModelSpaceNormal = normalize(ModelSpaceNormal);\n"
<< " \n";
}
@@ -279,7 +279,7 @@ bool CShaderGenerator::CreateVertexShader(const CMaterial& rkMat)
{
ShaderCode << " vec3 ModelSpacePos = RawPosition;\n";
if (VtxDesc & eNormal)
if (VtxDesc & EVertexAttribute::Normal)
ShaderCode << " vec3 ModelSpaceNormal = RawNormal.xyz;\n";
ShaderCode << "\n";
@@ -287,7 +287,7 @@ bool CShaderGenerator::CreateVertexShader(const CMaterial& rkMat)
ShaderCode << " gl_Position = vec4(ModelSpacePos, 1) * MVP;\n";
if (VtxDesc & eNormal)
if (VtxDesc & EVertexAttribute::Normal)
ShaderCode << " Normal = normalize(ModelSpaceNormal * inverse(transpose(mat3(MV))));\n";
// Per-vertex lighting
@@ -341,7 +341,7 @@ bool CShaderGenerator::CreateVertexShader(const CMaterial& rkMat)
EUVAnimMode AnimMode = pPass->AnimMode();
if (AnimMode == eNoUVAnim) // No animation
if (AnimMode == EUVAnimMode::NoUVAnim) // No animation
ShaderCode << " Tex" << iPass << " = vec3(" << gkCoordSrc[pPass->TexCoordSource()] << ");\n";
else // Animation used - texture matrix at least, possibly normalize/post-transform
@@ -349,7 +349,7 @@ bool CShaderGenerator::CreateVertexShader(const CMaterial& rkMat)
// Texture Matrix
ShaderCode << " Tex" << iPass << " = vec3(vec4(" << gkCoordSrc[pPass->TexCoordSource()] << ", 1.0) * TexMtx[" << iPass << "]).xyz;\n";
if ((AnimMode < 2) || (AnimMode > 5))
if ((AnimMode < EUVAnimMode::UVScroll) || (AnimMode > EUVAnimMode::VFilmstrip))
{
// Normalization + Post-Transform
ShaderCode << " Tex" << iPass << " = normalize(Tex" << iPass << ");\n"
@@ -373,10 +373,10 @@ bool CShaderGenerator::CreatePixelShader(const CMaterial& rkMat)
<< "\n";
FVertexDescription VtxDesc = rkMat.VtxDesc();
if (VtxDesc & ePosition) ShaderCode << "in vec3 Position;\n";
if (VtxDesc & eNormal) ShaderCode << "in vec3 Normal;\n";
if (VtxDesc & eColor0) ShaderCode << "in vec4 Color0;\n";
if (VtxDesc & eColor1) ShaderCode << "in vec4 Color1;\n";
if (VtxDesc & EVertexAttribute::Position) ShaderCode << "in vec3 Position;\n";
if (VtxDesc & EVertexAttribute::Normal) ShaderCode << "in vec3 Normal;\n";
if (VtxDesc & EVertexAttribute::Color0) ShaderCode << "in vec4 Color0;\n";
if (VtxDesc & EVertexAttribute::Color1) ShaderCode << "in vec4 Color1;\n";
uint32 PassCount = rkMat.PassCount();
@@ -441,14 +441,14 @@ bool CShaderGenerator::CreatePixelShader(const CMaterial& rkMat)
// Apply lightmap multiplier
if ( (PassType == "DIFF") ||
(PassType == "CUST" && (rkMat.Options() & CMaterial::eLightmap) && iPass == 0) )
(PassType == "CUST" && (rkMat.Options() & EMaterialOption::Lightmap) && iPass == 0) )
ShaderCode << " * LightmapMultiplier";
ShaderCode << ";\n";
ShaderCode << " Konst = vec4(" << gkKonstColor[pPass->KColorSel()] << ", " << gkKonstAlpha[pPass->KAlphaSel()] << ");\n";
if (pPass->RasSel() != eRasColorNull)
if (pPass->RasSel() != kRasColorNull)
ShaderCode << " Ras = " << gkRasSel[pPass->RasSel()] << ";\n";
for (uint8 iInput = 0; iInput < 4; iInput++)
@@ -479,7 +479,7 @@ bool CShaderGenerator::CreatePixelShader(const CMaterial& rkMat)
ShaderCode << "clamp(TevInD.a + ((1.0 - TevInC.a) * TevInA.a + TevInC.a * TevInB.a), 0.0, 1.0);\n\n";
}
if (rkMat.Options() & CMaterial::ePunchthrough)
if (rkMat.Options() & EMaterialOption::Masked)
{
if (rkMat.Version() < EGame::CorruptionProto)
{

View File

@@ -5,6 +5,21 @@
#include "Core/Resource/CMaterial.h"
#include <GL/glew.h>
/**
* @todo Would be great to have a more complex shader system that would allow
* more advanced things to be done with shaders and materials in particular.
* Currently every material only has one shader, which means any extra rendering
* effects that need to be rendered on a mesh that has a material has to be
* integrated directly into that material's shader and has to be toggled via a
* shader uniform, which is pretty messy. If you look at Unreal for instance,
* there is a much nicer system where the output of a material (color, emissive,
* opacity, etc) is provided via a function call in the shader code, and then
* you can write another shader on top that calls that function and then integrates
* the material output into the shader's output pixel color however you want, which
* allows for vastly more customization in how materials render for any given situation.
* As the current system stands, it's kind of a pain to extend with any new features,
* or to add any new graphical effects to game assets.
*/
class CShaderGenerator
{
CShader *mpShader;

View File

@@ -4,7 +4,11 @@
CVertexBuffer::CVertexBuffer()
{
mBuffered = false;
SetVertexDesc(ePosition | eNormal | eTex0 | eTex1 | eTex2 | eTex3 | eTex4 | eTex5 | eTex6 | eTex7);
SetVertexDesc(EVertexAttribute::Position | EVertexAttribute::Normal |
EVertexAttribute::Tex0 | EVertexAttribute::Tex1 |
EVertexAttribute::Tex2 | EVertexAttribute::Tex3 |
EVertexAttribute::Tex4 | EVertexAttribute::Tex5 |
EVertexAttribute::Tex6 | EVertexAttribute::Tex7);
}
CVertexBuffer::CVertexBuffer(FVertexDescription Desc)
@@ -25,22 +29,22 @@ uint16 CVertexBuffer::AddVertex(const CVertex& rkVtx)
{
if (mPositions.size() == 0xFFFF) throw std::overflow_error("VBO contains too many vertices");
if (mVtxDesc & ePosition) mPositions.push_back(rkVtx.Position);
if (mVtxDesc & eNormal) mNormals.push_back(rkVtx.Normal);
if (mVtxDesc & eColor0) mColors[0].push_back(rkVtx.Color[0]);
if (mVtxDesc & eColor1) mColors[1].push_back(rkVtx.Color[1]);
if (mVtxDesc & EVertexAttribute::Position) mPositions.push_back(rkVtx.Position);
if (mVtxDesc & EVertexAttribute::Normal) mNormals.push_back(rkVtx.Normal);
if (mVtxDesc & EVertexAttribute::Color0) mColors[0].push_back(rkVtx.Color[0]);
if (mVtxDesc & EVertexAttribute::Color1) mColors[1].push_back(rkVtx.Color[1]);
for (uint32 iTex = 0; iTex < 8; iTex++)
if (mVtxDesc & (eTex0 << iTex)) mTexCoords[iTex].push_back(rkVtx.Tex[iTex]);
if (mVtxDesc & (EVertexAttribute::Tex0 << iTex)) mTexCoords[iTex].push_back(rkVtx.Tex[iTex]);
for (uint32 iMtx = 0; iMtx < 8; iMtx++)
if (mVtxDesc & (ePosMtx << iMtx)) mTexCoords[iMtx].push_back(rkVtx.MatrixIndices[iMtx]);
if (mVtxDesc & (EVertexAttribute::PosMtx << iMtx)) mTexCoords[iMtx].push_back(rkVtx.MatrixIndices[iMtx]);
if (mVtxDesc.HasAnyFlags(eBoneIndices | eBoneWeights) && mpSkin)
if (mVtxDesc.HasAnyFlags(EVertexAttribute::BoneIndices | EVertexAttribute::BoneWeights) && mpSkin)
{
const SVertexWeights& rkWeights = mpSkin->WeightsForVertex(rkVtx.ArrayPosition);
if (mVtxDesc & eBoneIndices) mBoneIndices.push_back(rkWeights.Indices);
if (mVtxDesc & eBoneWeights) mBoneWeights.push_back(rkWeights.Weights);
if (mVtxDesc & EVertexAttribute::BoneIndices) mBoneIndices.push_back(rkWeights.Indices);
if (mVtxDesc & EVertexAttribute::BoneWeights) mBoneWeights.push_back(rkWeights.Weights);
}
return (mPositions.size() - 1);
@@ -55,35 +59,35 @@ uint16 CVertexBuffer::AddIfUnique(const CVertex& rkVtx, uint16 Start)
// I use a bool because "continue" doesn't work properly within the iTex loop
bool Unique = false;
if (mVtxDesc & ePosition)
if (mVtxDesc & EVertexAttribute::Position)
if (rkVtx.Position != mPositions[iVert]) Unique = true;
if (!Unique && (mVtxDesc & eNormal))
if (!Unique && (mVtxDesc & EVertexAttribute::Normal))
if (rkVtx.Normal != mNormals[iVert]) Unique = true;
if (!Unique && (mVtxDesc & eColor0))
if (!Unique && (mVtxDesc & EVertexAttribute::Color0))
if (rkVtx.Color[0] != mColors[0][iVert]) Unique = true;
if (!Unique && (mVtxDesc & eColor1))
if (!Unique && (mVtxDesc & EVertexAttribute::Color1))
if (rkVtx.Color[1] != mColors[1][iVert]) Unique = true;
if (!Unique)
for (uint32 iTex = 0; iTex < 8; iTex++)
if ((mVtxDesc & (eTex0 << iTex)))
if ((mVtxDesc & (EVertexAttribute::Tex0 << iTex)))
if (rkVtx.Tex[iTex] != mTexCoords[iTex][iVert])
{
Unique = true;
break;
}
if (!Unique && mpSkin && (mVtxDesc.HasAnyFlags(eBoneIndices | eBoneWeights)))
if (!Unique && mpSkin && (mVtxDesc.HasAnyFlags(EVertexAttribute::BoneIndices | EVertexAttribute::BoneWeights)))
{
const SVertexWeights& rkWeights = mpSkin->WeightsForVertex(rkVtx.ArrayPosition);
for (uint32 iWgt = 0; iWgt < 4; iWgt++)
{
if ( ((mVtxDesc & eBoneIndices) && (rkWeights.Indices[iWgt] != mBoneIndices[iVert][iWgt])) ||
((mVtxDesc & eBoneWeights) && (rkWeights.Weights[iWgt] != mBoneWeights[iVert][iWgt])) )
if ( ((mVtxDesc & EVertexAttribute::BoneIndices) && (rkWeights.Indices[iWgt] != mBoneIndices[iVert][iWgt])) ||
((mVtxDesc & EVertexAttribute::BoneWeights) && (rkWeights.Weights[iWgt] != mBoneWeights[iVert][iWgt])) )
{
Unique = true;
break;
@@ -102,26 +106,26 @@ void CVertexBuffer::Reserve(uint16 Size)
{
uint32 ReserveSize = mPositions.size() + Size;
if (mVtxDesc & ePosition)
if (mVtxDesc & EVertexAttribute::Position)
mPositions.reserve(ReserveSize);
if (mVtxDesc & eNormal)
if (mVtxDesc & EVertexAttribute::Normal)
mNormals.reserve(ReserveSize);
if (mVtxDesc & eColor0)
if (mVtxDesc & EVertexAttribute::Color0)
mColors[0].reserve(ReserveSize);
if (mVtxDesc & eColor1)
if (mVtxDesc & EVertexAttribute::Color1)
mColors[1].reserve(ReserveSize);
for (uint32 iTex = 0; iTex < 8; iTex++)
if (mVtxDesc & (eTex0 << iTex))
if (mVtxDesc & (EVertexAttribute::Tex0 << iTex))
mTexCoords[iTex].reserve(ReserveSize);
if (mVtxDesc & eBoneIndices)
if (mVtxDesc & EVertexAttribute::BoneIndices)
mBoneIndices.reserve(ReserveSize);
if (mVtxDesc & eBoneWeights)
if (mVtxDesc & EVertexAttribute::BoneWeights)
mBoneWeights.reserve(ReserveSize);
}
@@ -157,7 +161,7 @@ void CVertexBuffer::Buffer()
for (uint32 iAttrib = 0; iAttrib < 14; iAttrib++)
{
int Attrib = (ePosition << iAttrib);
int Attrib = (EVertexAttribute::Position << iAttrib);
bool HasAttrib = ((mVtxDesc & Attrib) != 0);
if (!HasAttrib) continue;
@@ -247,7 +251,7 @@ GLuint CVertexBuffer::CreateVAO()
for (uint32 iAttrib = 0; iAttrib < 14; iAttrib++)
{
int Attrib = (ePosition << iAttrib);
int Attrib = (EVertexAttribute::Position << iAttrib);
bool HasAttrib = ((mVtxDesc & Attrib) != 0);
if (!HasAttrib) continue;

View File

@@ -1,5 +1,5 @@
#include "GLCommon.h"
#include <stdexcept>
#include <Common/Macros.h>
GLenum gBlendFactor[] =
{
@@ -25,16 +25,16 @@ GLenum gZMode[] =
GL_ALWAYS // GX_ALWAYS
};
GLenum GXPrimToGLPrim(EGXPrimitiveType Type)
GLenum GXPrimToGLPrim(EPrimitiveType Type)
{
switch (Type) {
case eGX_Quads: return GL_TRIANGLE_STRIP; // Quads are converted to strips
case eGX_Triangles: return GL_TRIANGLE_STRIP; // Triangles are converted to strips
case eGX_TriangleStrip: return GL_TRIANGLE_STRIP;
case eGX_TriangleFan: return GL_TRIANGLE_STRIP; // Fans are converted to strips
case eGX_Lines: return GL_LINES;
case eGX_LineStrip: return GL_LINE_STRIP;
case eGX_Points: return GL_POINTS;
default: throw std::invalid_argument("Invalid GX primitive type");
case EPrimitiveType::Quads: return GL_TRIANGLE_STRIP; // Quads are converted to strips
case EPrimitiveType::Triangles: return GL_TRIANGLE_STRIP; // Triangles are converted to strips
case EPrimitiveType::TriangleStrip: return GL_TRIANGLE_STRIP;
case EPrimitiveType::TriangleFan: return GL_TRIANGLE_STRIP; // Fans are converted to strips
case EPrimitiveType::Lines: return GL_LINES;
case EPrimitiveType::LineStrip: return GL_LINE_STRIP;
case EPrimitiveType::Points: return GL_POINTS;
default: ASSERT(false); return GL_INVALID_ENUM;
}
}

View File

@@ -4,31 +4,33 @@
#include <Common/BasicTypes.h>
#include <GL/glew.h>
enum EBlendFactor
enum class EBlendFactor
{
eBlendZero = GL_ZERO,
eBlendOne = GL_ONE,
eBlendSrcColor = GL_SRC_COLOR,
eBlendInvSrcColor = GL_ONE_MINUS_SRC_COLOR,
eBlendSrcAlpha = GL_SRC_ALPHA,
eBlendInvSrcAlpha = GL_ONE_MINUS_SRC_ALPHA,
eBlendDstAlpha = GL_DST_ALPHA,
eBlendInvDstAlpha = GL_ONE_MINUS_DST_ALPHA
Zero = GL_ZERO,
One = GL_ONE,
SrcColor = GL_SRC_COLOR,
InvSrcColor = GL_ONE_MINUS_SRC_COLOR,
SrcAlpha = GL_SRC_ALPHA,
InvSrcAlpha = GL_ONE_MINUS_SRC_ALPHA,
DstAlpha = GL_DST_ALPHA,
InvDstAlpha = GL_ONE_MINUS_DST_ALPHA
};
enum EGXPrimitiveType
enum class EPrimitiveType
{
eGX_Quads = 0x80,
eGX_Triangles = 0x90,
eGX_TriangleStrip = 0x98,
eGX_TriangleFan = 0xA0,
eGX_Lines = 0xA8,
eGX_LineStrip = 0xB0,
eGX_Points = 0xB8
// The values assigned here match the defines for primitive types in GX
// and appear in geometry data in game file formats
Quads = 0x80,
Triangles = 0x90,
TriangleStrip = 0x98,
TriangleFan = 0xA0,
Lines = 0xA8,
LineStrip = 0xB0,
Points = 0xB8
};
extern GLenum gBlendFactor[];
extern GLenum gZMode[];
GLenum GXPrimToGLPrim(EGXPrimitiveType Type);
GLenum GXPrimToGLPrim(EPrimitiveType Type);
#endif // GLCOMMON_H