Commits

wahrhaft committed a1c35b7

Support compiling against video plugin API 2.1.0
(TODO: properly set the redraw flag)

Comments (0)

Files changed (4)

 BOOL    capture_screen = 0;
 char    capture_path[256];
 
-void (*renderCallback)() = NULL;
+void (*renderCallback)(int) = NULL;
 static void (*l_DebugCallback)(void *, int, const char *) = NULL;
 static void *l_DebugCallContext = NULL;
 
   LOG ("ShowCFB ()\n");
 }
 
-EXPORT void CALL SetRenderingCallback(void (*callback)())
+EXPORT void CALL SetRenderingCallback(void (*callback)(int))
 {
     renderCallback = callback;
 }
 
 #define PLUGIN_NAME              "Glide64 Video Plugin"
 #define PLUGIN_VERSION           0x016305
-#define VIDEO_PLUGIN_API_VERSION 0x020000
+#define VIDEO_PLUGIN_API_VERSION 0x020100
 #define CONFIG_API_VERSION       0x020000
 #define VIDEXT_API_VERSION       0x020000
 
 BOOL ucode_error_report = TRUE;
 int wrong_tile = -1;
 
+int drawFlag = 1;	// draw flag for rendering callback
+
 #if defined(WIN32) || defined(NO_ASM)
   #define BYTESWAP1(s1) s1 = ((s1 & 0xff) << 24) | ((s1 & 0xff00) << 8) | ((s1 & 0xff0000) >> 8) | ((s1 & 0xff000000) >> 24);
   #define BYTESWAP2(s1,s2) s1 = ((s1 & 0xff) << 24) | ((s1 & 0xff00) << 8) | ((s1 & 0xff0000) >> 8) | ((s1 & 0xff000000) >> 24); \

src/wrapper/main.cpp

 extern int getEnableFBO();
 extern int getDisableAuxbuf();
 
+extern int drawFlag;	// draw flag for rendering callback
+
 #ifdef WIN32
 PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
 PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
 }
 
 
-extern void (*renderCallback)();
+extern void (*renderCallback)(int);
 
 // #include <unistd.h>
 FX_ENTRY void FX_CALL
 grBufferSwap( FxU32 swap_interval )
 {
   if(renderCallback)
-    (*renderCallback)();
+    (*renderCallback)(drawFlag);
+  drawFlag = 1;	//TODO: set drawFlag to 0 here
+  //TODO: need to find the proper place to set drawFlag to 1 when a frame has been rendered
+
   int i;
     WriteLog(M64MSG_VERBOSE, "grBufferSwap(%d)\r\n", swap_interval);
   //printf("swap\n");