summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2008-10-25 09:59:00 +0000
committerhrydgard <hrydgard@gmail.com>2008-10-25 09:59:00 +0000
commitf14fca914d769fbbb7929348d816bd947594efa9 (patch)
tree44f0ca2462a7bc12b7845c62a9191d66ea094131 /Source/Core
parent63793c7f4f230bc7169090048e3a3324d5300a6c (diff)
OpenGL - Don't cache pointer to compiled code - cache pointer to NativeVertexFormat instead.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@950 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/VideoCommon/Src/NativeVertexFormat.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/Src/NativeVertexFormat.h b/Source/Core/VideoCommon/Src/NativeVertexFormat.h
index 817b5ded1f..42f925da01 100644
--- a/Source/Core/VideoCommon/Src/NativeVertexFormat.h
+++ b/Source/Core/VideoCommon/Src/NativeVertexFormat.h
@@ -62,13 +62,13 @@ typedef void (LOADERDECL *TPipelineFunction)(const void *);
// The implementation of this class is specific for GL/DX, so NativeVertexFormat.cpp
// is in the respective plugin, not here in VideoCommon.
+// This class will also be split into NativeVertexFormat and VertexFormatConverter.
+// VertexFormatConverters will be cached, indexed by TVtxDesc+TVtxAttr.
+
// Note that this class can't just invent arbitrary vertex formats out of its input -
// all the data loading code must always be made compatible.
class NativeVertexFormat
{
- void SetupColor(int num, int _iMode, int _iFormat, int _iElements);
- void SetupTexCoord(int num, int _iMode, int _iFormat, int _iElements, int _iFrac);
-
public:
NativeVertexFormat();
~NativeVertexFormat();
@@ -76,6 +76,12 @@ public:
void Initialize(const TVtxDesc &vtx_desc, const TVtxAttr &vtx_attr);
void RunPipelineOnce(const TVtxAttr &vtx_attr) const;
+ void SetupVertexPointers() {
+ // Cast a pointer to compiled code to a pointer to a function taking no parameters, through a (void *) cast first to
+ // get around type checking errors, and call it.
+ ((void (*)())(void*)m_compiledCode)();
+ }
+
// TODO: move these in under private:
int m_VBVertexStride; // PC-side vertex stride
int m_VBStridePad;