Commit Graph

37 Commits

Author SHA1 Message Date
b3760aa3fc Re-enable collision and implement game lose screen 2016-12-18 19:48:14 +11:00
35e0569f8d Add score multiplier into game 2016-11-30 21:21:28 +11:00
10891ab56e Add resolution changer in options menu 2016-11-29 01:41:33 +11:00
eb4b0e1714 Rudimentary resolution changer, window icon 2016-11-28 19:11:38 +11:00
aeeef1a60f Add state data buffer to hold generic configs
Add some system that allows us to automatically define and allocate different
application states at runtime without having to manually make the entries into
our game state structure.

It's basically an array of pointers determined by the app states defined in the
appstate enum. This is necessary since different modes, (start menu, options,
game world) have different data and we'd like to be able to define them
uniquely.
2016-11-28 17:47:15 +11:00
6df92e7aed Change naming convention, merge texture/shaders
Reduce the number of files in project by merging texture and shaders into
assets/renderer file. It's better to keep code local to where it is rather than
splitting them into "self-contained modules". It becomes easier to understand
reading top-to-bottom and there's is less jumping around which can increase the
difficulty of comprehending the code.

Convert names to use more of a <namespace>_<object><Action> format.
2016-11-27 21:16:12 +11:00
ad14d6d822 Introduce temp memory to free memory leaks 2016-11-27 17:26:23 +11:00
5bb7fa8c13 Improve input handling using state flags
Fix reading one shot inputs not working due to prematurely clearing out state
data tracking input changes between one frame and another. The transition count
used to track this now stores difference between each frame in the input flags.

This also solves requiring at the end of the frame to update the transition
counts at the end of each update loop.
2016-11-25 18:03:25 +11:00
6bc37dbe44 Add Asteroid sizing and asteroid split on destroy 2016-11-25 13:17:24 +11:00
42ba86f05a Add ability to shoot and delete entities 2016-11-24 18:57:44 +11:00
981d87a2d7 Add proper wireframe mode, rotation to triangle 2016-11-12 00:22:09 +11:00
6d67485d49 Add primitive triangle rendering code 2016-11-11 21:43:03 +11:00
4795fe1cb1 Switch developing game to asteroids, start project
Switch to something of smaller scope in aim to be able to finish a project from
start to finish. Also allow refreshed eyes to review the existing API and see
what can be improved on after taking a short break from the project.
2016-11-09 22:36:41 +11:00
332888f3b5 Switch mem allocation to custom memory block
No longer repeatedly invoke malloc for retrieving memory. Some operations still
leak memory (notably audio streaming). We introduce notion of Transient and
Permanent storage. Transient memory is used for data in memory that is
temporarily allocated (i.e. graphics for that frame's output), and permanent as
more like game state storage.

We now give out pointers from a pre-allocated block of memory, so we have no
allocation cost and benefits of reduced memory leaks. The transient block gets
reset every frame. Any memory allocated within is cleared at no cost simply by
rearranging the base pointer of the memory block.
2016-09-24 14:43:59 +10:00
82421ca64c Improve performance by swapping render groups
Last used render groups are brought to front of render list when searching for
valid group- as per- recently used items are likely to be used again.
2016-09-23 19:36:18 +10:00
cb857cfaa6 Reassign debug keys, backspace on textfield added 2016-08-17 15:57:42 +10:00
80b35d404d Add better input parsing with key repeat tracking 2016-08-17 02:21:02 +10:00
22973ef51d Add text field draft implementation 2016-08-10 21:52:05 +10:00
eb1962e05e IMGUI use data from Gamestate, fix pointInRect bug
Wrong if logic causing point-in-rect to be valid if only x or y is
valid, where correct logic is both x and y need to be within the rect.
2016-08-04 21:17:16 +10:00
aa505ed0b3 Remove input dependency on GLFW in game code
Create own platform abstraction for keyboard input for use in game code.
2016-08-04 18:19:02 +10:00
85becdfd6c Merge the game to dengine, reduce header coupling
Until engine architecture can clearly be separated from the game, i.e.
notion of entity storage belonging to game and concept of entity belonging
to engine, worlds/scenes belonging to game or engine- the project will
only refer to Dengine.
2016-07-28 15:19:23 +10:00
630f2eaa5d Add audio looping, simplify audio API
Audio can be played with 1 call, audio_beginVorbisStream which
encapsulates the initialisation of the renderer and release on finish.
OpenAL is quoted to have a limitation of around 32 sources. Audio
renderers hence acquire a source slot on playback and immediately release
on finish. This ensures that sources are held optimally and minimises the
possibility of saturating the available sources.

Renderers hold an index to the source list, which the index reveals the
source ID for their use.
2016-07-27 22:50:14 +10:00
824d8fd8a0 Initial integration of audio to entity structure 2016-07-27 18:39:51 +10:00
54dd5c84fa Enumerate audio devices, add multi-audio rendering 2016-07-27 16:52:10 +10:00
84a0f755ea Abstract audio playback into own file 2016-07-27 01:34:26 +10:00
99a700ca13 Add audio-streaming and loop support 2016-07-26 18:47:55 +10:00
6b2e759257 Basic audio with stb_vorbis decoding and openal 2016-07-25 22:10:50 +10:00
71faaa78c4 Add openal-soft dependency, update opengl macro 2016-07-24 22:19:25 +10:00
fd94eb5afd Mobs battle with hero, engine architect. changes
Mobs battle in real-time with the hero when in range. Start encapsulating
logic into entityStateSwitch() to organise entity properties changing
between different states.

Introduce basic concept of memory management in MemoryArena. Begin passing
around a memory object to track memory usage and eventually delegate
memory allocations through. Remove the old memory tracker in the debug
object and incorporate into engine primarily.

Add a debug console for logging information and events to the screen in
a console-like fashion. Debug is now initialised after the game, this is
so that you can pass the game's memory arena and font file to the debug
services. Debug services now properly initialise debug element positions
from this information and not through the update routine.
2016-07-19 21:19:26 +10:00
7971b10b74 Remove int v2 type, change V2i to cast i32 to f32
Mixing and matching V2 int and float types in the code creates too much
necessary work when an integer implementation has to interact with float
implementation. Let V2i create the cast for us and use floats for all
vector operations since they are mostly mathematic.
2016-07-17 23:45:59 +10:00
a426461dad Fix up include headers, try to reduce dependencies
Ensure that all headers are self-sufficient instead of relying on included
headers to include headers for execution.
2016-07-16 23:27:52 +10:00
1f364f7024 Update debug data architecture and methods 2016-07-09 20:46:04 +10:00
d8ee46611f Renderer calculates NDC coordinates from screen coords 2016-06-29 20:44:35 +10:00
e03d3fd14a Rudimentary font rasterisation at runtime with STB 2016-06-29 03:17:03 +10:00
76d6dfcf2f Change notation for dengine headers 2016-06-28 16:00:03 +10:00
e638724c75 Add tile grid and atlas concept to game 2016-06-25 21:23:15 +10:00
753d700ca6 Complete port over to C, replace glm math lib 2016-06-18 19:12:09 +10:00