Commits

wahrhaft committed ada2d63

update to 2.1.0 API

  • Participants
  • Parent commits 4c27074

Comments (0)

Files changed (4)

File src/GraphicsPlugin.cpp

 
     //glFlush();    
     //OpenGLManager::getSingleton().endRendering();
-
+	OpenGLManager::getSingleton().setDrawFlag();
     //Take screenshot?
 }
 

File src/OpenGLManager.cpp

 {
     glFinish();
     if (m_renderingCallback)
-        m_renderingCallback();
+        m_renderingCallback(m_drawFlag);
+	m_drawFlag = 0;
     CoreVideo_GL_SwapBuffers();
     //glFlush();
 }

File src/OpenGLManager.h

     void setClearColor(float r, float g, float b) { glClearColor(r, g, b, 1.0f); }
 
     //Set callback from the M64P core
-    void setRenderingCallback(void(*callback)()) { m_renderingCallback = callback; }
+    void setRenderingCallback(void(*callback)(int)) { m_renderingCallback = callback; }
+	
+	//Set draw flag for rendering callback
+	void setDrawFlag() { m_drawFlag = 1; }
 
 public:
 
     bool m_fullscreen;           //!< Fullscreen mode or window mode?
     bool m_forceDisableCulling;  //!< Culling cant be enabled if this is true
     
-    void (*m_renderingCallback)();  //Rendering callback from the core
+    void (*m_renderingCallback)(int);  //Rendering callback from the core
+	int m_drawFlag;
 };
 
 #endif

File src/main.cpp

 //Definitions
 #define PLUGIN_NAME "Arachnoid Video Plugin"
 #define PLUGIN_VERSION           0x016304
-#define VIDEO_PLUGIN_API_VERSION 0x020000
+#define VIDEO_PLUGIN_API_VERSION 0x020100
 #define CONFIG_API_VERSION       0x020000
 #define VIDEXT_API_VERSION       0x020000
 
 GraphicsPlugin    g_graphicsPlugin;                              //!< Main class for application
 Config            g_config(&g_graphicsPlugin);                   //!< Handles configuration
 
-void (*renderCallback)() = NULL;
+void (*renderCallback)(int) = NULL;
 
 
 /* definitions of pointers to Core config functions */
 //! Allows the core to register a callback function that will be called by the 
 //! graphics plugin just before the the frame buffers are swapped.
 //-----------------------------------------------------------------------------
-EXPORT void CALL SetRenderingCallback(void (*callback)())
+EXPORT void CALL SetRenderingCallback(void (*callback)(int))
 {
     OpenGLManager::getSingleton().setRenderingCallback(callback);
 }