Logo
SpriteBatch.h
1#pragma once
2
3#include "Types.h"
4#include "gfx/CommonPrimitive.h"
5
6namespace SharpKmyGfx
7{
8 public ref class SpriteBatch
9 {
10 public:
11
13 {
14 obj = TRACK_NEW_CLASS kmyGfx::SpriteBatch();
15 }
16
17 void Release()
18 {
19 SAFE_REMOVE_REF(obj);
20 }
21
22 void setLayer(int layer)
23 {
24 }
25
26 static SharpKmyMath::Matrix4 makeMatrix(float posX, float posY, float rotX, float rotY, float rotZ, float scaleX, float scaleY, float pivotX, float pivotY);
27
28 void drawSprite(Texture ^tex, int x, int y, int ofsx, int ofsy, int w, int h, float rot, float u0, float v0, float u1, float v1, float r, float g, float b, float a, int zOrder, Shader ^shd, bool clip);
29 void drawSprite(SharpKmyMath::Matrix4 mtx, Texture^ tex, int ofsx, int ofsy, int w, int h, float u0, float v0, float u1, float v1, float r, float g, float b, float a, int zOrder, Shader^ shd, bool clip);
30
31 void setMask(Texture^ tex, int x, int y, int ofsx, int ofsy, int w, int h, float rot, float u0, float v0, float u1, float v1, float r, float g, float b, float a);
32 void setMask(SharpKmyMath::Matrix4 mtx, Texture^ tex, int ofsx, int ofsy, int w, int h, float u0, float v0, float u1, float v1, float r, float g, float b, float a);
33
34 void resetMask();
35 void pushClip(SharpKmyMath::Matrix4 mtx, int clipX, int clipY, int clipWidth, int clipHeight, bool recurisve);
36 void popClip();
37
38#if KMY_VR
39 void drawSpriteVr(Texture ^tex, int x, int y, int ofsx, int ofsy, int w, int h, float rot, float u0, float v0, float u1, float v1, float r, float g, float b, float a, int zOrder);
40 void drawSpriteVr(SharpKmyMath::Matrix4 mtx, Texture^ tex, int ofsx, int ofsy, int w, int h, float u0, float v0, float u1, float v1, float r, float g, float b, float a, int zOrder);
41#endif // #if KMY_VR
42 void drawText(Font^ font, cli::array<byte>^ text, int x, int y, float r, float g, float b, float a, float scale, int zOrder, bool italic, bool clip);
43 void drawRect(int x, int y, int w, int h, float rot, float r, float g, float b, float a, float scale, bool clip, int zOrder);
44 void drawLineRect(int x, int y, int offsetX, int offsetY, int w, int h, float rot, float r, float g, float b, float a, float scale, int zOrder);
45
46 void drawText(SharpKmyMath::Matrix4 mtx, Font^ font, cli::array<byte>^ text, float r, float g, float b, float a, int zOrder, bool italic, bool clip);
47 void drawRect(SharpKmyMath::Matrix4 mtx, int w, int h, float r, float g, float b, float a, bool clip, int zOrder);
48 void drawLineRect(SharpKmyMath::Matrix4 mtx, int offsetX, int offsetY, int w, int h, float r, float g, float b, float a, int zOrder);
49
50 void setCameraMatrix(float fovy, float xAngle, float yAngle);
53 void setScreenSizeX(int width, int height);
54 InternalCommandList^ createCommandList(Framebuffer^ fb, int screenWidth, int screenHeight);
55
56 kmyGfx::SpriteBatch *obj = nullptr;
57 };
58
59
60}
Definition: Font.h:11
Definition: InternalCommandBuffer.h:94
Definition: InternalCommandBuffer.h:152
Definition: Shader.h:8
Definition: SpriteBatch.h:9
void setCameraMatrix(float fovy, float xAngle, float yAngle)
Definition: SpriteBatch.cpp:281
static SharpKmyMath::Matrix4 makeMatrix(float posX, float posY, float rotX, float rotY, float rotZ, float scaleX, float scaleY, float pivotX, float pivotY)
Definition: SpriteBatch.cpp:11
void popClip()
Definition: SpriteBatch.cpp:120
void drawSprite(Texture ^tex, int x, int y, int ofsx, int ofsy, int w, int h, float rot, float u0, float v0, float u1, float v1, float r, float g, float b, float a, int zOrder, Shader ^shd, bool clip)
SpriteBatch()
Definition: SpriteBatch.h:12
void setProjectionMatrix(SharpKmyMath::Matrix4 proj)
Definition: SpriteBatch.cpp:286
void drawText(Font^ font, cli::array< byte >^ text, int x, int y, float r, float g, float b, float a, float scale, int zOrder, bool italic, bool clip)
Definition: SpriteBatch.cpp:174
void setMask(Texture^ tex, int x, int y, int ofsx, int ofsy, int w, int h, float rot, float u0, float v0, float u1, float v1, float r, float g, float b, float a)
Definition: SpriteBatch.cpp:64
void setLayer(int layer)
Definition: SpriteBatch.h:22
InternalCommandList createCommandList(Framebuffer^ fb, int screenWidth, int screenHeight)
Definition: SpriteBatch.cpp:301
void setScreenSizeX(int width, int height)
Definition: SpriteBatch.cpp:296
void drawLineRect(int x, int y, int offsetX, int offsetY, int w, int h, float rot, float r, float g, float b, float a, float scale, int zOrder)
Definition: SpriteBatch.cpp:252
void drawRect(int x, int y, int w, int h, float rot, float r, float g, float b, float a, float scale, bool clip, int zOrder)
Definition: SpriteBatch.cpp:222
void setViewMatrix(SharpKmyMath::Matrix4 view)
Definition: SpriteBatch.cpp:291
kmyGfx::SpriteBatch * obj
Definition: SpriteBatch.h:56
void Release()
Definition: SpriteBatch.h:17
void pushClip(SharpKmyMath::Matrix4 mtx, int clipX, int clipY, int clipWidth, int clipHeight, bool recurisve)
Definition: SpriteBatch.cpp:111
void resetMask()
Definition: SpriteBatch.cpp:103
Definition: Texture.h:72
Definition: Matrix4.h:10
Definition: Billboard.cpp:4