renderer.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. Copyright (C) 2004 Michael Liebscher
  3. Copyright (C) 1997-2001 Id Software, Inc.
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License
  6. as published by the Free Software Foundation; either version 2
  7. of the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15. */
  16. /*
  17. * renderer.h: Interface to graphics API.
  18. *
  19. * Author: Michael Liebscher <johnnycanuck@users.sourceforge.net>
  20. * Date: 2004
  21. *
  22. * Acknowledgement:
  23. * This code was derived from Quake II, and was originally
  24. * written by Id Software, Inc.
  25. *
  26. */
  27. /*
  28. Notes:
  29. This module communicates with the graphics API. The API can be any graphics
  30. API, e.g OpenGL, DirectX, SDL, GDI, etc; as long as the functions listed in
  31. this header are implemented.
  32. */
  33. #ifndef __RENDERER_H__
  34. #define __RENDERER_H__
  35. #ifdef _WIN32
  36. #define OPENGL_DLL_NAME "opengl32.dll"
  37. #elif __unix__
  38. #define OPENGL_DLL_NAME "libGL.so.1"
  39. #elif IPHONE
  40. #define OPENGL_DLL_NAME "not applicable"
  41. #else
  42. #error "Define OPENGL_DLL_NAME"
  43. #endif
  44. typedef enum
  45. {
  46. rserr_ok,
  47. rserr_invalid_fullscreen,
  48. rserr_invalid_mode,
  49. rserr_unknown
  50. } rserr_t;
  51. extern int registration_sequence;
  52. extern void R_Init( void );
  53. extern void R_Shutdown( void );
  54. extern void R_BeginRegistration( const char *model );
  55. extern void R_BeginFrame( void );
  56. extern void R_EndFrame( void );
  57. extern void R_AppActivate( _boolean active );
  58. extern void R_SwapBuffers( int );
  59. extern void R_SetPalette( const unsigned char *palette);
  60. extern void R_DeleteTexture( unsigned int texnum );
  61. extern void R_Draw_Pic( int x, int y, const char *name );
  62. extern void R_Draw_StretchPic( int x, int y, int w, int h, const char *name );
  63. extern void R_Draw_Character( int x, int y, int num, font_t *myfont );
  64. extern void R_Draw_Tile( int x, int y, int w, int h, const char *name );
  65. extern void R_Draw_Fill( int x, int y, int w, int h, colour3_t c );
  66. extern void R_Draw_Line( int nXStart, int nYStart, int nXEnd, int nYEnd, int width, colour3_t c );
  67. #endif /* __RENDERER_H__ */