As my 3D engine is forever-unfinished, I decided to use stuff I learned to write 2D module. I decided to keep max2D syntax (might add pl at begggining for documentation), but use opengl3.3. In result I have easy to use, max2d like, VAO,instancing,glsl330 etc. based library :). Example of Code:
SuperStrict
Import plerengine.maths
Import plerengine.glsl
Include "inc/Game.bmx"
Include "inc/pler2D/pler2D.bmx"
Graphics(1024,768)
AutoMidHandle(True)
Global img1:plImage = LoadAnimImage("gfx/test.bmp",256,64,0,4)
Global img2:plImage = LoadImage("gfx/test.bmp")
While Not KeyHit(key_Escape)
Cls
'SetColor(100,30,40)
'SetDepth(0)
SetAlpha(0.5)
SetRotation(MouseX())
SetBlend(SOLIDBLEND)
If MouseDown(1)
SetShader(GRAYSCALESHADER) ' there are few default included, and easy way to add more.
Else
SetShader(IDENTITYSHADER)
EndIf
DrawImage(img2,1024,768)
SetOrigin(MouseX(),MouseY())
DrawWorld() ' force engine to draw all images stacked, this is also called when blend or shader is changed.
Flip
Wend
|