x86UNIXDedicatedStub.cc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2013 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. #ifdef DEDICATED
  23. // GL stubs
  24. #ifndef NULL
  25. #define NULL 0
  26. #endif
  27. #include "platformX86UNIX/platformGL.h"
  28. #include "platform/platformAL.h"
  29. #include "platform/platformInput.h"
  30. #include "platformX86UNIX/x86UNIXFont.h"
  31. // declare stub functions
  32. #define GL_FUNCTION(fn_return, fn_name, fn_args, fn_value) fn_return stub_##fn_name fn_args{ fn_value }
  33. #include "platform/GLCoreFunc.h"
  34. #include "platform/GLExtFunc.h"
  35. #include "platform/GLUFunc.h"
  36. #undef GL_FUNCTION
  37. // point gl function pointers at stub functions
  38. #define GL_FUNCTION(fn_return,fn_name,fn_args, fn_value) fn_return (*fn_name)fn_args = stub_##fn_name;
  39. #include "platform/GLCoreFunc.h"
  40. #include "platform/GLExtFunc.h"
  41. #include "platform/GLUFunc.h"
  42. #undef GL_FUNCTION
  43. GLState gGLState;
  44. bool gOpenGLDisablePT = false;
  45. bool gOpenGLDisableCVA = false;
  46. bool gOpenGLDisableTEC = false;
  47. bool gOpenGLDisableARBMT = false;
  48. bool gOpenGLDisableFC = false;
  49. bool gOpenGLDisableTCompress = false;
  50. bool gOpenGLNoEnvColor = false;
  51. float gOpenGLGammaCorrection = 0.5;
  52. bool gOpenGLNoDrawArraysAlpha = false;
  53. // AL stubs
  54. //#include <al/altypes.h>
  55. //#include <al/alctypes.h>
  56. //#define INITGUID
  57. //#include <al/eaxtypes.h>
  58. // Define the OpenAL and Extension Stub functions
  59. #define AL_FUNCTION(fn_return, fn_name, fn_args, fn_value) fn_return stub_##fn_name fn_args{ fn_value }
  60. #include <al/al_func.h>
  61. #include <al/alc_func.h>
  62. #include <al/eax_func.h>
  63. #undef AL_FUNCTION
  64. #include "platform/platformInput.h"
  65. // Declare the OpenAL and Extension Function pointers
  66. // And initialize them to the stub functions
  67. #define AL_FUNCTION(fn_return,fn_name,fn_args, fn_value) fn_return (*fn_name)fn_args = stub_##fn_name;
  68. #include <al/al_func.h>
  69. #include <al/alc_func.h>
  70. #include <al/eax_func.h>
  71. #undef AL_FUNCTION
  72. namespace Audio
  73. {
  74. bool OpenALDLLInit() { return false; }
  75. void OpenALDLLShutdown() {}
  76. }
  77. // Platform Stubs
  78. const char* Platform::getClipboard() { return ""; }
  79. bool Platform::setClipboard(const char *text) { return false; }
  80. GOldFont *createFont(const char *name, dsize_t size, U32 charset) { return NULL; }
  81. void PlatformBlitInit( void ) {}
  82. PlatformFont *createPlatformFont(const char *name, U32 size, U32 charset) { return NULL; }
  83. bool x86UNIXFont::create(const char *name, U32 size, U32 charset) { return false; }
  84. // Input stubs
  85. void Input::init() {}
  86. void Input::destroy() {}
  87. bool Input::enable() { return false; }
  88. void Input::disable() {}
  89. void Input::activate() {}
  90. void Input::deactivate() {}
  91. void Input::reactivate() {}
  92. U16 Input::getAscii( U16 keyCode, KEY_STATE keyState ) { return 0; }
  93. U16 Input::getKeyCode( U16 asciiCode ) { return 0; }
  94. bool Input::isEnabled() { return false; }
  95. bool Input::isActive() { return false; }
  96. void Input::process() {}
  97. InputManager* Input::getManager() { return NULL; }
  98. void GLLoader::OpenGLShutdown() {}
  99. bool OpenGLInit() { return false; }
  100. #endif