Advertisement
Guest User

threadedOpenGLTestPlugin.h

a guest
Jul 10th, 2011
1,082
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.83 KB | None | 0 0
  1. /**********************************************************\
  2.  
  3.   Auto-generated threadedOpenGLTestPlugin.h
  4.  
  5.   This file contains the auto-generated main plugin object
  6.   implementation for the threadedOpenGLTestPlugin project
  7.  
  8.   Example from Kai Rathmann and Eamon Woortman
  9.  
  10. \**********************************************************/
  11. #ifndef H_threadedOpenGLTestPluginPLUGIN
  12. #define H_threadedOpenGLTestPluginPLUGIN
  13.  
  14. #include "PluginWindow.h"
  15. #include "PluginEvents/MouseEvents.h"
  16. #include "PluginEvents/AttachedEvent.h"
  17. #include "PluginEvents/KeyboardEvents.h"
  18. #include "PluginEvents/DrawingEvents.h"
  19. #include "PluginCore.h"
  20.  
  21.  
  22. //opengl thread stuff
  23. #include <windows.h>
  24.  
  25.  
  26. #include <stdio.h>
  27. //#include <strsafe.h> <STRSAFE.H>
  28. FB_FORWARD_PTR(threadedOpenGLTestPlugin)
  29. class threadedOpenGLTestPlugin : public FB::PluginCore
  30. {
  31. public:
  32.     static void StaticInitialize();
  33.     static void StaticDeinitialize();
  34.  
  35. public:
  36.     threadedOpenGLTestPlugin();
  37.     virtual ~threadedOpenGLTestPlugin();
  38.  
  39. public:
  40.     void onPluginReady();
  41.     void shutdown();
  42.     virtual FB::JSAPIPtr createJSAPI();
  43.    
  44.     static void EnableOpenGL(HWND handleWnd, HDC * hdc, HGLRC * hRC);
  45.    
  46.     //boost::thread t = NULL;
  47.     // If you want your plugin to always be windowless, set this to true
  48.     // If you want your plugin to be optionally windowless based on the
  49.     // value of the "windowless" param tag, remove this method or return
  50.     // FB::PluginCore::isWindowless()
  51.     virtual bool isWindowless() { return false; }
  52.     static LPTHREAD_START_ROUTINE drawThreaded( LPVOID lpParam );
  53.  
  54.     BEGIN_PLUGIN_EVENT_MAP()
  55.         EVENTTYPE_CASE(FB::MouseDownEvent, onMouseDown, FB::PluginWindow)
  56.         EVENTTYPE_CASE(FB::MouseUpEvent, onMouseUp, FB::PluginWindow)
  57.         EVENTTYPE_CASE(FB::MouseMoveEvent, onMouseMove, FB::PluginWindow)
  58.         EVENTTYPE_CASE(FB::MouseMoveEvent, onMouseMove, FB::PluginWindow)
  59.         EVENTTYPE_CASE(FB::KeyDownEvent, onKeyDown, FB::PluginWindow)
  60.         EVENTTYPE_CASE(FB::AttachedEvent, onWindowAttached, FB::PluginWindow)
  61.         EVENTTYPE_CASE(FB::DetachedEvent, onWindowDetached, FB::PluginWindow)
  62.         EVENTTYPE_CASE(FB::RefreshEvent, draw, FB::PluginWindow)
  63.        
  64.     END_PLUGIN_EVENT_MAP()
  65.  
  66.     /** BEGIN EVENTDEF -- DON'T CHANGE THIS LINE **/
  67.     virtual bool onMouseDown(FB::MouseDownEvent *evt, FB::PluginWindow *);
  68.     virtual bool onMouseUp(FB::MouseUpEvent *evt, FB::PluginWindow *);
  69.     virtual bool onMouseMove(FB::MouseMoveEvent *evt, FB::PluginWindow *);
  70.     virtual bool onKeyDown(FB::KeyDownEvent* evt, FB::PluginWindow*);
  71.     virtual bool onWindowAttached(FB::AttachedEvent *evt, FB::PluginWindow *);
  72.     virtual bool onWindowDetached(FB::DetachedEvent *evt, FB::PluginWindow *);
  73.     virtual bool draw( FB::RefreshEvent *evt, FB::PluginWindow* win );
  74.     /** END EVENTDEF -- DON'T CHANGE THIS LINE **/
  75. };
  76.  
  77.  
  78. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement