Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaysmito101 authored Oct 16, 2022
1 parent c081df8 commit 6d31990
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


# CGL
CGL (C Graphics Library) is a multipurpose library mainly for recreational coding / demoscenes / proptotyping / small games / experementation. This has a lot of utilities for graphics. And best of all all of it is inside a single header file `cgl.h`. Also CGL is made purely in C but is also compatible with C++.
CGL (C Graphics Library) is a multipurpose library mainly for recreational coding / demo scenes / prototyping / small games / experimentation. This has a lot of utilities for graphics. And best of all all of it is inside a single header file `cgl.h`. Also CGL is made purely in C but is also compatible with C++.

NOTE: Do not think that header only means its going to increase compile time as the implementation needs be enabled only for 1 file using `#define CGL_IMPLEMENTATION`

Expand All @@ -26,7 +26,7 @@ NOTE: Do not think that header only means its going to increase compile time as

* Windowing library (Optional)
- You can completely disable it by `#define CGL_EXCLUDE_WINDOW_API`
- This windowing library is primarily a wrapper GLFW along with a few extra functionalities. For example in case you are using some library like `nuklear` for gui it will mess up all `glfw` callbacks so with CGL you can restore the CGL callbacks with a call to `CGL_window_resecure_callbacks`
- This windowing library is primarily a wrapper GLFW along with a few extra functionalities. For example in case you are using some library like `nuklear` for GUI it will mess up all `glfw` callbacks so with CGL you can restore the CGL callbacks with a call to `CGL_window_resecure_callbacks`

* Utility functionalities
- Reading/Writing files
Expand All @@ -38,8 +38,8 @@ NOTE: Do not think that header only means its going to increase compile time as

* Data structures
- List(dynamic array) + Stack (implemented together)
- Hashtable -> This hastabpe is general purpose. Key can be string or a n-bit buffer. The value can be anything int, string, float, custom types, ...
- Hashtable Iterator -> Iteratate through the hashtable usign a [simple](https://github.com/Jaysmito101/cgl/blob/main/examples/using_hashtable_iterator.c) API
- Hashtable -> This hastable is general purpose. Key can be string or a n-bit buffer. The value can be anything int, string, float, custom types, ...
- Hashtable Iterator -> Iterate through the hashtable using a [simple](https://github.com/Jaysmito101/cgl/blob/main/examples/using_hashtable_iterator.c) API

* Cross Platform Networking (Optional)
- You can disable all networking by `#define CGL_EXCLUDE_NETWORKING`
Expand All @@ -51,56 +51,56 @@ NOTE: Do not think that header only means its going to increase compile time as
- Can work with any type of data ( text / image / etc. )
- Train/Generate with 3 - 4 lines of code
- Trainer implemented for text generation (n-gram based)
- Custom trainer API for custom scenerios
- Custom trainer API for custom scenarios

* Cross Platform Threading
- Threads
- Mutex
- Condition Variables (TODO)
- NOTE: Implmented using `Win32 Threads` on Windows and `pthread` on linux. (on linux you need to link `pthread` to build)
- NOTE: Implemented using `Win32 Threads` on Windows and `pthread` on Linux. (on Linux you need to link `pthread` to build)

* CGL Widgets (Optional)
- You can disable it by `#define CGL_EXCLUDE_WIDGETS`
- API Like [p5.js](https://p5js.org/)
- Bach Renderer backend (very fast even for a large number of widgets)
- draw (filled or stroked) :
- triangle [`CGL_widgets_add_triangle`]
- geeneral quad [`CGL_widgets_add_quad`]
- general quad [`CGL_widgets_add_quad`]
- rectangle [`CGL_widgets_add_rect` `CGL_widgets_add_rect2f`]
- line [`CGL_widgets_add_line`]
- circle [`CGL_widgets_add_circle` `CGL_widgets_add_circle2f`]
- oval [`CGL_widgets_add_oval`, `CGL_widgets_add_oval2f`]
- Add individual verticices
- Add individual vertices
- Adjust stroke color/thickness
- Customize Batch renderer max vertices capacity (for low memory systems)

* Math library
- vec2/vec3/vec4
- mat3/mat4
- add/sub/mul/div/scale/length/normalize/lerm/min/max/equal for vec2/vec3/vec4
- add/sub/mul/div/scale/length/normalize/lerp/min/max/equal for vec2/vec3/vec4
- rotate_x/rotate_y/rotate_z for vec3
- scale/translate/rotate_x/rotate_y/rotate_z/add/sub/mul for mat4
- perspective for mat4
- transpose for mat4/(mat3 TODO)
- look_at matrix
- NOTE: Most of math functions are implemented via macros so wil be totally inlined and quite fast without any unnecessary function calls
- NOTE: Most of math functions are implemented via macros so will be totally inclined and quite fast without any unnecessary function calls

* High Level OpenGL API for (Optional)
- You can completely disable it by `#define CGL_EXCLUDE_GRAPHICS_API`
- Texture (2D / 2D Array / Cubemap)
- Texture (2D / 2D Array / Cube map)
- Framebuffers
- SSBO (Shader Storge Buffer Object)
- SSBO (Shader Storage Buffer Object)
- Shaders
- Vertex & Fragment (Geometry Shader not included as its not very widely used)
- Compute Shader API

* CGL Mesh API
- CGL has a higl level api for handling meshes
- CGL has a high level API for handling meshes
- 2 types of meshes are there
- CPU mesh -> stores the data also used for mesh operations like
- generate triangle
- generate quad
- load obj (beta)
- load OBJ (beta)
- generate cube
- generate sphere
- generate mesh out of any parametric surface function [refer here](https://stackoverflow.com/a/31326534/14911094)
Expand All @@ -109,7 +109,7 @@ NOTE: Do not think that header only means its going to increase compile time as
- render
- render instanced
- render wireframe
- reander wireframe instanced
- render wireframe instanced

* CGL camera
- CGL provides a proper camera abstraction
Expand All @@ -118,16 +118,16 @@ NOTE: Do not think that header only means its going to increase compile time as
- Auto calculates the Up, Right, Front vectors

* Text Rendering (Optional) (Requires [FreeType2](http://freetype.org/))
- You can completely diable it with `#define CGL_EXCLUDE_TEXT_RENDER`
- You can completely disable it with `#define CGL_EXCLUDE_TEXT_RENDER`
- Load Fonts from `.ttf` files
- Bake bitmaps for characters
- Bake textures from strings


* Sky Renderer (Optional)
- You can completely diable it with `#define CGL_EXCLUDE_SKY_RENDERER`
- You can completely disable it with `#define CGL_EXCLUDE_SKY_RENDERER`
- Supports both a Sky Box (cube mesh) and Sky Sphere/Dome (sphere mesh)
- Supports Cubemap Textured Sky
- Supports Cube map Textured Sky
- Supports Realtime Procedurally Generated Sky ( + procedural clouds)
- Render a beautiful sky with just 3 - 5 lines of code

Expand Down

0 comments on commit 6d31990

Please sign in to comment.