*/}}

ourpaint.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #include "la_5.h"
  2. STRUCTURE(OurCanvasDraw){
  3. laCanvasExtra Base;
  4. int ShowTiles;
  5. real CanvasLastX,CanvasLastY;
  6. real LastPressure;
  7. };
  8. #define OUR_TILE_W 64
  9. #define OUR_TEX_TILE_W 1024
  10. #define OUR_TEX_TILES_PER_ROW 100
  11. #define OUR_TILES_PER_ROW (OUR_TEX_TILES_PER_ROW*(OUR_TEX_TILE_W/OUR_TILE_W))
  12. #define OUR_TEX_TILE_CTR (OUR_TEX_TILES_PER_ROW/2)
  13. #define OUR_TEX_TILE_SEAM 12
  14. #define OUR_TEX_TILE_W_USE (OUR_TEX_TILE_W-OUR_TEX_TILE_SEAM*2)
  15. STRUCTURE(OurTile){
  16. int X,Y; // with offset so not neccessarily n*OUR_TILE_W
  17. void* Data;
  18. };
  19. STRUCTURE(OurTexTile){
  20. tnsTexture* Texture;
  21. };
  22. STRUCTURE(OurLayer){
  23. laListItem Item;
  24. laSafeString Name;
  25. int OffsetX,OffsetY;
  26. OurTexTile** TexTiles[OUR_TEX_TILES_PER_ROW];
  27. };
  28. STRUCTURE(OurBrush){
  29. laListItem Item;
  30. laSafeString Name;
  31. real Size;
  32. real DabsPerSize;
  33. real Hardness;
  34. real Transparency;
  35. real Smudge;
  36. };
  37. STRUCTURE(OurDab){
  38. float X,Y;
  39. float Size;
  40. float Hardness;
  41. float Smudge;
  42. float Color[4];
  43. };
  44. STRUCTURE(OurPaint){
  45. real pad;
  46. laListHandle Layers;
  47. OurLayer* CurrentLayer;
  48. laListHandle Brushes;
  49. OurBrush* CurrentBrush;
  50. real BrushRemainingDist;
  51. OurDab* Dabs; int NextDab,MaxDab;
  52. tnsTexture* Content;
  53. GLuint CanvasShader;
  54. GLuint CanvasProgram;
  55. GLint uBrushCorner;
  56. GLint uBrushCenter;
  57. GLint uBrushSize;
  58. GLint uBrushHardness;
  59. GLint uBrushSmudge;
  60. GLint uBrushColor;
  61. real CurrentColor[4];
  62. };
  63. void ourInit();