Recent

Author Topic: Quickstart: Making games with Lazarus  (Read 2545 times)

sysrpl

  • Sr. Member
  • ****
  • Posts: 315
    • Get Lazarus
Quickstart: Making games with Lazarus
« on: December 01, 2015, 07:41:04 am »
A few days ago people on this forum were discussing using Time within game projects and I chimed in with this example:

http://www.getlazarus.org/videos/barecube/

Which is how my simple framework for creating cross platform games works. You have a logic entry point (which can be on its own thread) that processes input and manages game state, and a render entry point which converts the game state into graphics. The synchronization between the two is the TStopwatch class, a high performance timer giving you all the time information you need to animate your game.

Further...

BareGame supports and wraps vertex buffers and shaders. It provides a nice way to reuse or define your own vertex types (lit, with textures, or with user data). It also provides nice sprite types and 2d vector graphics (strokes, shapes, and brush types to fill strokes or shapes).

BareGame does not discourage direct access to OpenGL/OpenGL ES. You can mix OpenGL in with your render code ad hoc and doing so is encouraged. It's called BareGame because it's minimal. There are no dependencies other than SDL 2, and it doesn't do everything (or even close to that). There are no mesh loaders, skeletal animation classes, frustrum culling, ect.

BareGame just gets you quickly started (like SDL 2) while providing nice object wrappers for the core stuff you'll need: creating a window, managing threads, reading input, managing sounds, managing textures, and drawing text/vector shapes/sprites, plus a few other nice things.

uses
  Bare.System,
  Bare.Game,
  Bare.Graphics,
  Bare.Example,
  Bare.Interop.OpenGL;


Regarding the organization:

Bare.System Provides extensions to types, threading, loading dynamic modules
Bare.Game Wraps everything SDL, window management, keyboard, joystick, screens, sound, event queue
Bare.Graphics Textures, vertex pipeline, sprites, fonts, world (2d <-> 3d mapping), canvas
Bare.Example An example window class with world and fonts and other things already attached
Bare.Interop.OpenGL OpenGL/OpenGL ES API plus some helper functions (i.e. querying supported versions, extension handling)

For more information on BareGame follow the link at the top on this topic.

Here's another example with less direct OpenGL calls:

http://www.getlazarus.org/videos/baresprites/

Features: Separate threads, loading resources from http urls, texture filtering (linear/nearest), sprites, canvas vector drawing, processing the keyboard, working with sound samples/banks.

 

TinyPortal © 2005-2018