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(SharpKmyMath::Matrix4 mtx, Texture^ tex, float ofsx, float ofsy, float w, float h, float u0, float v0, float u1, float v1, float r, float g, float b, float a, int zOrder, Shader^ shd, bool clip);
29
30 void setMask(SharpKmyMath::Matrix4 mtx, Texture^ tex, float ofsx, float ofsy, float w, float h, float u0, float v0, float u1, float v1, float r, float g, float b, float a);
31
32 void resetMask();
33 void pushClip(SharpKmyMath::Matrix4 mtx, float clipX, float clipY, float clipWidth, float clipHeight, bool recurisve);
34 void popClip();
35
36#if KMY_VR
37 void drawSpriteVr(Texture ^tex, float x, float y, float ofsx, float ofsy, float w, float h, float rot, float u0, float v0, float u1, float v1, float r, float g, float b, float a, int zOrder);
38 void drawSpriteVr(SharpKmyMath::Matrix4 mtx, Texture^ tex, float ofsx, float ofsy, float w, float h, float u0, float v0, float u1, float v1, float r, float g, float b, float a, int zOrder);
39#endif // #if KMY_VR
40
41 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);
42 void drawRect(SharpKmyMath::Matrix4 mtx, float w, float h, float r, float g, float b, float a, int zOrder, bool useClip);
43 void drawLineRect(SharpKmyMath::Matrix4 mtx, float ofsx, float ofsy, float w, float h, float r, float g, float b, float a, int zOrder);
44
45 void setCameraMatrix(float fovy, float xAngle, float yAngle);
48 void setScreenSizeX(float width, float height);
49 void createCommandList(InternalCommandBuffer^ icb, Framebuffer^ fb, int screenWidth, int screenHeight);
50
51 kmyGfx::SpriteBatch *obj = nullptr;
52 };
53
54
55}
Definition: Font.h:11
Definition: Framebuffer.h:8
Definition: InternalCommandBuffer.h:13
Definition: Shader.h:8
Definition: SpriteBatch.h:9
void setCameraMatrix(float fovy, float xAngle, float yAngle)
Definition: SpriteBatch.cpp:211
void pushClip(SharpKmyMath::Matrix4 mtx, float clipX, float clipY, float clipWidth, float clipHeight, bool recurisve)
Definition: SpriteBatch.cpp:79
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:90
void drawSprite(SharpKmyMath::Matrix4 mtx, Texture^ tex, float ofsx, float ofsy, float w, float h, float u0, float v0, float u1, float v1, float r, float g, float b, float a, int zOrder, Shader^ shd, bool clip)
Definition: SpriteBatch.cpp:24
void setMask(SharpKmyMath::Matrix4 mtx, Texture^ tex, float ofsx, float ofsy, float w, float h, float u0, float v0, float u1, float v1, float r, float g, float b, float a)
Definition: SpriteBatch.cpp:48
SpriteBatch()
Definition: SpriteBatch.h:12
void setProjectionMatrix(SharpKmyMath::Matrix4 proj)
Definition: SpriteBatch.cpp:218
void createCommandList(InternalCommandBuffer^ icb, Framebuffer^ fb, int screenWidth, int screenHeight)
Definition: SpriteBatch.cpp:239
void drawLineRect(SharpKmyMath::Matrix4 mtx, float ofsx, float ofsy, float w, float h, float r, float g, float b, float a, int zOrder)
Definition: SpriteBatch.cpp:195
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)
Definition: SpriteBatch.cpp:150
void setLayer(int layer)
Definition: SpriteBatch.h:22
void setScreenSizeX(float width, float height)
Definition: SpriteBatch.cpp:232
void drawRect(SharpKmyMath::Matrix4 mtx, float w, float h, float r, float g, float b, float a, int zOrder, bool useClip)
Definition: SpriteBatch.cpp:177
void setViewMatrix(SharpKmyMath::Matrix4 view)
Definition: SpriteBatch.cpp:225
kmyGfx::SpriteBatch * obj
Definition: SpriteBatch.h:51
void Release()
Definition: SpriteBatch.h:17
void resetMask()
Definition: SpriteBatch.cpp:69
Definition: Texture.h:12
Definition: Matrix4.h:12
Definition: Asset.h:4