First Draft version of Direct2D porting to Visual Basic .NET and First Try to create a Simple Game Engine with Snake test game. It is very early release.
Thanks to Direct2D instead of GDI, it uses GPU power to render each frame. It uses a multi-thread approach for rendering.
- Include VBDirect2D and SimpleGameEngine class in your project.
- Create new class and inherit SimpleGameEngine class
- Override OnSessionCreate(), OnSessionDelete() and OnFrameUpdate(ByVal fElapsed As Single) subs
Public Class TestClass
Inherits SimpleGameEngine
Protected Overrides Sub OnSessionCreate()
' Create resources
MyBase.OnSessionCreate()
End Sub
Protected Overrides Sub OnFrameUpdate(fElapsed As Single)
' Clear screen
Clear(Color.MidnightBlue)
MyBase.OnFrameUpdate(fElapsed)
End Sub
End Class
Use Left,Up,Right,Down Arrow to control Snake