• Stars
    star
    1,720
  • Rank 27,141 (Top 0.6 %)
  • Language
    C
  • License
    Other
  • Created over 13 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Pure C Game Engine

Corange game engine

Version 0.8.0

Written in Pure C, SDL and OpenGL.

Running

Corange is a library, but to take a quick look at some of the things it does you can Look at some of the Demos. Warning: Some things shown are from a previous version and may not remain the same in this version.

Compiling

To compile on Windows you need MinGW and then you should be able to run "make" as usual. You will need to have installed SDL, SDL_Mixer and SDL_Net.

make

To compile on Linux you need to install SDL2. Then you should run "make"

sudo apt-get install libsdl2-dev
sudo apt-get install libsdl2-mixer-dev
sudo apt-get install libsdl2-net-dev
make

Overview

  • Small, Simple, Powerful, Cross platform
  • Clean and easy Asset, UI, Entity management
  • Modern Deferred renderer

Demos

I'm a graphics programmer by trade so apologies that most of the demos are graphical apps; they're just what I love!

  • renderers Shows off the various renderers with shaders, shadows, animation etc.
  • metaballs Uses OpenCL/OpenGL interop to do Metaball rendering.
  • noise Feedback based noise pattern on screen using shader. Can generate tileable perlin noise in software.
  • platformer Basic platforming game. Fairly well commented.
  • sea Renders a sea-like surface, a ship, and some collision detection.
  • scotland Demonstrates terrain system.
  • tessellation Demo showing tessellation shaders in OpenGL 4.

FAQ

  • How is that pronounced?

    Rhymes with Purple.

  • Why not C++?

    There are plenty of C++ engines which do what I've done here and better. Pure C game engines on the other hand are much rarer. Corange provided me an outlet to practice my C skills. Of course if you are just linking to it you can still program your game/executable using C++.

  • What stuff does it do?

    I've used it as a platform for trying out all sorts of techniques and effects. These features are not out-of-the-box or plug-in-and-play, but if you are a developer who has knowledge of what they are, you should be able to utilize what I have written. Some are WIP or rough around the edges.

    Deferred Rendering / UI Rendering / Text Rendering. Multiple Lights. Post effects. SSAO. Shadow Mapping. Color Correction. Skeletal Animation. Inverse Kinematics. Collision Detection. OpenCL support. Asset / Entity / UI Management. Terrain. File loaders including .dds, .wav, .bmp, .obj, .smd. Maths and Geometry. And More...

  • Can I use this for 2D stuff?

    Certainly. Though Corange doesn't provide a 2D renderer for you. That you can write yourself. Believe it or not, making a generalized 2D renderer can be exceedingly complicated when you have to optimise for different sprites, tile sets, dynamic objects and all sorts of other effects. You're better off writing the rendering code application specific.

  • Can I contact you about something?

    Yes - [email protected]

Using / Contributing

This is still mainly a personal project and so there are going to be lots of bugs, unfinished features and messy bits of code. The engine is heavily WIP and subject to sweeping changes. It isn't really viable to use without also being part of the project development and in communication with me. Rather than a full game engine like Unity, Corange is more of a framework and gives you access to features at about the same level as XNA.

I have a big backlog of Work in Progress changes I need to push up to the repository once they get to a reasonable point so if you are interested in those please contact me.

Saying that, it is a great excuse to practise your C and I very much welcome help. If the project appeals to you here are a couple of quick things that might help get you started.

  • First take a look at the demos. These give a brief overview of how Corange can be used. The platformer demo is probably the most commented.

  • There is no real documentation so your first port of call is the header files and your second is the c files. The code has very minimal comments but should be pretty clear most of the time.

  • Corange doesn't hide anything from you. OpenGL and SDL calls are in the namespace so you've got access to the basics. The corange_init and corange_finish functions are fairly short so it is even possible to not call them and only use the components you want.

  • Structs are typedefed without their pointer. The reason for this is a personal choice but there are also quite a few data types which are passed by value on the stack (vectors, matrices, spheres, boxes). I didn't want the notion of these to get confused.

  • Some important parts of the engine are the asset, UI and entity managers. These basically let you access and store assets (models, textures - objects in the file system) and entities (lights, cameras, engine objects) and UI elements. They clean up memory on destruction and let you get pointers from all parts of the code.

  • Corange mangles the namespace pretty badly, taking names such as "error", "warning", "vec2" and "image". It isn't a general purpose library. But I've still tried to decouple stuff so it should be possible to extract certain code if you need it.

More Repositories

1

Cello

Higher level programming in C
C
6,212
star
2

BuildYourOwnLisp

Learn C and build your own programming language in under 1000 lines of code!
HTML
2,792
star
3

mpc

A Parser Combinator library for C
C
2,648
star
4

tgc

A Tiny Garbage Collector for C
C
902
star
5

Motion-Matching

Learned Motion Matching example implementation and source code for the article "Code vs Data Driven Displacement"
C++
615
star
6

LuaAutoC

Automagically use C Functions and Structs with the Lua API
C
257
star
7

CPP_COMPLETE

Brainfuck interpreter written in the C preprocessor
C++
226
star
8

BVHView

A simple viewer for the .bvh animation file format written using raylib.
C
202
star
9

json2c

Convert JSON to C data literals
C
122
star
10

imgcurses

ncurses Image Viewer
C
114
star
11

Spring-It-On

Code for the article Spring-It-On
C
86
star
12

ptest

DRY Microtesting Framework for C
C
79
star
13

Joint-Limits

Source code for the article "Joint Limits"
C++
76
star
14

PyAutoC

Automatically wrap C functions & structs at run time for the Python/C API
Python
70
star
15

Python-xNormal

Python Wrapper for xNormal
Python
65
star
16

GenoView

An example raylib application for viewing animation on the Geno character
C
62
star
17

Animation-Looping

Source code for the article "Creating Looping Animations from Motion Capture"
C++
52
star
18

Animation-Velocities

Source code for the article Propagating Velocities through Animation Systems
C++
32
star
19

QuaternionAverage

Source code for the article "Quaternion Weighted Average"
C++
20
star
20

PyMark

Python flavoured object markup.
C++
17
star
21

Ranges

Source code for the article Tags, Ranges and Masks
C++
17
star
22

zeroeggs-retarget

Retargeting of the ZeroEGGs dataset onto a common character
Python
2
star
23

Cello-Website

libCello Website
JavaScript
1
star
24

lafan1-resolved

Resolving of the Ubisoft La Forge Animation dataset onto a common skeleton
Python
1
star
25

motorica-retarget

Retargeting of the Motorica Dance dataset onto a common skeleton
Python
1
star