Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1.  
  2.  
  3. #ifndef _GRAPHICCORE_H
  4. #define _GRAPHICCORE_H
  5.  
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <pspkernel.h>
  10. #include <pspdebug.h>
  11. #include <pspdisplay.h>
  12. #include <pspaudio.h>
  13. #include <psprtc.h>
  14.  
  15. #include <png.h>
  16.  
  17. #include <string>
  18. #include "BasicTypes.h"
  19. //------------------------------------------------------------------------------------------------
  20.  
  21. class GraphicCore
  22. {
  23. private:
  24. bool mVsync;
  25.  
  26. int mSwizzle;
  27. int mTexCounter;
  28.  
  29. int mCurrentTex;
  30. int mCurrentBlend;
  31. PIXEL_TYPE* mVRAM;
  32.  
  33. u32 mVideoBufferStart;
  34. u32 mCurrentPointer;
  35. public:
  36.  
  37. GraphicCore();
  38. virtual ~GraphicCore();
  39.  
  40. static GraphicCore * GetInstance();
  41.  
  42. void Init();
  43. void Destroy();
  44.  
  45. void BeginRender();
  46. void EndRender();
  47.  
  48. void RenderQuad(Quad* quad, float xo, float yo,
  49. float angle = 0.0f, float xScalexScale = 1.0f, float yScale = 1.0f);
  50.  
  51. void FillRect(int x, int y, int width, int height, PIXEL_TYPE color);
  52. void DrawLine(int x1, int y1, int x2, int y2, PIXEL_TYPE color);
  53. void Plot(int x, int y, PIXEL_TYPE color);
  54. void PlotArray(float * x, float * y, int count, PIXEL_TYPE color);
  55.  
  56. void ScreenShot(const char* filename);
  57.  
  58. Texture * LoadTexture(const char* filename, bool useVideoRAM = false);
  59. Texture * LoadTexture(String filename, bool useVideoRAM = false)
  60. {
  61. return LoadTexture(filename.c_str());
  62.  
  63. }
  64.  
  65. void ClearScreen(PIXEL_TYPE color);
  66.  
  67. void EnableVSync(bool flag) { mVsync = flag; }
  68.  
  69. void ResetPrivateVRAM() { mCurrentPointer = mVideoBufferStart; }
  70.  
  71. String LoadFile(String filename);
  72.  
  73.  
  74. };
  75.  
  76.  
  77. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement