Coder Social home page Coder Social logo

wic_c's Introduction

wic readme

Table of Contents

  1. Summary
  2. Directories and Files
  3. Building wic
  4. Using wic in your project
  5. Licensing and Distribution
  6. Credits

Summary

Wic is a 2D game engine for Mac OSX written in C and distributed as a standalone static library. I am building Wic with the following design goals in mind:

  • simplicity
  • extensibility
  • robust and easy error reporting
  • detailed documentation
  • library-wide consistency
  • flexibility in memory management

You can download files, read documentation, and submit bug reports at wic's github repository.

Enjoy!

Directories and Files

  • license.md -- License.
  • readme.md -- Readme.
  • Makefile -- Makefile.
  • deps/ -- Dependency files.
    • lib/ -- Dependency libraries.
    • include/ -- Dependency header files.
  • doc/ -- Doxygen documentation.
  • include/ -- Header files.
  • lib/ -- Dependency libraries.
  • src/ -- Source files.
  • bin/ -- Libraries [created on build].
    • debug/ -- Debug library (debug/libwic.a) [created on build].
    • release/ -- Release library (release/libwic.a) [created on build].
  • obj/ -- Object files [created on build].
    • debug/ -- Debug objects [created on build].
    • release/ -- Release objects [created on build].

Building wic

Wic uses the standard "make" to build. No configure script is included, mostly because the makefile is so small and easy to modify. It should build on any system with gcc, make, and binutils installed. From wic's root directory, the following make commands can be executed:

  • $ make -- Builds wic as a static library.
  • $ make all -- Functions identically to "$ make".
  • $ make release -- Functions identically to "$ make".
  • $ make debug -- Builds wic as a static library with debug symbols.
  • $ make doxygen -- Generates wic's doxygen documentation.
  • $ make clean -- Removes all library and object files.

Using wic in your project

First, you'll need to include wic's header files.

  1. Copy include/ and deps/ into your project.
  2. In your project, delete deps/lib to save space. You won't be needing it.
  3. Add include/ and deps/include as include paths. In gcc, this can be done with "-I include/ -I deps/include", assuming include/ and deps/ are in your working directory.

Second, you'll need to link in the appropriate libraries and frameworks.

  1. From wic's root directory, run $make.
  2. Copy libwic.a from lib/release/ into your project.
  3. Link libwic.a to your project. In gcc, this is done with "-lwic" assuming that libwic.a is in your working directory.
  4. You'll also need to link in the Cocoa, Quartz, IOKit, and OpenGL frameworks. In gcc, this can be done with "-framework Cocoa -framework Quartz -framework IOKit -framework OpenGL".

Lastly, you'll need to include "wic_lib.h" in all the code you write. Then you should be good to go!

Licensing and Distribution

Wic is distributed under the GNU Lesser General Public License, Version 3. You must include license.md in all projects which use the entirety or sections of wic.

Credits

Portions of this software are copyright © 2013 The FreeType Project. All rights reserved. Website.

Portions of this software use GLFW. Copyright © 2002-2006 Marcus Geelnard and Copyright © 2006-2011 Camilla Berglund. Website.

Portions of this software use the Simple OpenGL Image Library, which is in the public domain. Website.

wic_c's People

Contributors

wolearyc avatar

Watchers

James Cloos avatar  avatar

wic_c's Issues

Doxygen function documentation

Doxygen isn't generating documentation for any functions because files don't have a \file tag. The following line should be added just before the include guards:
/** \file */

Documentation style

Change the comment style of the documentation to standard C style, so Xcode can collapse the comments,

simplify interface

Completely redesign the interface, moving away from OO concepts and towards a more C-like implementation. This may involve global variables within C files and other stuff.

This simplification will also result in a rewrite of a lot of documention. Remember to use \param[out] when necessary.

Buttons

Create buttons which have an on and off state and has click detection.

Text delimiters

Add functionality to use text delimiters (\n, \t, etc.) when rendering text.

Disks and Arcs

Find a way to draw a disk

Disks should have 1 constructor:
Disk (Location, radius, color, segments)

Arcs can be subclasses of Circle, which is a subclass of disk (unfilled disk):
Arc(location, radius, width, color, arclength, segments)
Arclength could be replaced with angularArcLength if that's easier.

Unfilled shapes

Split up Polygon, Quad, and Disk into unfilled classes.
UnfilledPolygon, UnfilledQuad, Circle (unfilleddisk).

Unfilled shapes can be achieved by using GL_LINE..., not GL_POLYGON.

Add splash screen

Create an easy-to-add splash screen with customizable background and text color.

Sound

Wic should be able to load wav and ogg files. It should be able to play each file on repeat, or just once. Wic should also implement sounds mapped onto a 2d plane.

Convert to C

This whole C++ thing is getting way to too complicated.

Lighting

Create Light and DirectionalLight class.

Also create classes for objects that block/reflect light.

  • This should basically be an extension of all the shape clases

Default constructors for Font and Texture

Having working, valid default constructors will allow exception handling to go more smoothly and allow every class that uses them to have real default constructors as well.

For Font, load a font that will be on every mac.

For Texture, load a purple and white 3X3 checkerboard.

class enums

Replace all "enum" declarations with "enum class"

Image Bounds Exception

Make out-of-bounds Image exception non-fatal. When the bounds go outside the Texture, just throw the exception and make the bounds cover the entire Texture.

Cross-platform Build System

Redo the build system to be entirely cross-platform. This might involve either including the source of every dependency and compiling, or just including static libraries for every platform (this option of preferable, to keep things simple).

Platforms:

  • osx / 64
  • osx / 32
  • win / 64
  • win / 32
  • lin / 64
  • lin / 32

Split up Exceptions

Define many Exceptions in WickException.h and WickException.ccp. Make sure to update Documentation (\exception _____).

redesign error system.

A special wic_errno integer is available in wic_error.h as a global variable. This variable stores error codes. It's up the user to check wic_errno for more detailed error information.

Most functions return a bool, with false indicating failure and true indicating success.

Some functions return unsigned. In this case, 0 indicates failure, while values > 0 indicate success.

Some functions return pointers. If this case, 0 (null) indicates failure while anything else indicates success.

wic_errno codes will be contained in wic_error.h, so they can be assigned values unique automatically in one big enumeration.

This enhancement should be included in the commit for #28.

nullptr

Replace all NULLs and 0s when assigning pointers to "nullptr" in order to comply with C++11.

Window resizing.

Add functions within game that resize the window.
Analyze how user-side window-resizing works.

  • This may involve using screen coordinates instead of pixel coordinates.
  • If this happens, make sure the center remains at the center, and that the screen coordinates do not get warped or stretched (to prevent pixels from stretching).

Add shapes with collision detection

Possible types of HitBoxes:

  1. Rectangle
  2. Circle
  3. Polygon

Fist possible test is whether a hitbox contains a point:
Rectangle, circle are easy. Polygon is fairly easy (ray casting). At least for this operation, I think only circle and polygon structures will be required.

Second possible test is whether two hitboxes are overlapping.
Rectangle-rectangle, circle-circle are easy. Circle-polygon is easy (just check for a vertex within the polygon). General polygon collision is hardest (use separated axis theorem).

Conclusion: We want to implement machinery for circles and polygons.

WicHitBox{
circle = true/false
location
radius (set if circle)
vertices (set if not circle)
len_verticies (set if not circle)
}

wic_init_hitrect
wic_init_hitcirc
wic_init_hitpoly

Disks and arcs.

Implement filled circles, or disks.

Arcs will be a subclass of Circle (an unfilled disk)

const for Color

Label all of Color's static variables as const to avoid accidental changing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.