GithubHelp home page GithubHelp logo

claudiouzelac / osx_handmade Goto Github PK

View Code? Open in Web Editor NEW

This project forked from itfrombit/osx_handmade

0.0 1.0 0.0 790 KB

OS X port of Handmade Hero

Objective-C++ 13.20% C++ 81.98% Makefile 4.49% Shell 0.33%

osx_handmade's Introduction

osx_handmade

A port of Handmade Hero (http://handmadehero.org) for OS X.

This repository works with Casey's source code from handmade_hero_day_341.

Note 2016-09-30:

The TIMED_FUNCTION() macro in handmade_debug_interface.h does not compile under clang. I've hacked a temporary fix for this, but hopefully Casey will address this in a not-too-distant episode.

To fix the source code, run

sh fix_handmade_hero_source.sh

after copying over Casey's source code, but before running 'make' for the first time. Run 'make' from the code subdirectory.

Some things have changed from earlier versions. The directory structure has been cleaned up and is now more compatible with the Handmade Hero Github repository.

The architecture of the platform layer has also changed. CVDisplayLink is no longer used. Instead, OpenGL vsync is used to update the frame. Also, a new manual run loop was implemented to be more compatible with the Windows platform layer.

The platform layer no longer creates an explicit NSOpenGLView-derived object. This object was just extra boilerplate code. We now just create an OpenGLContext and assign it to the application's default contentView.

Finally, I combined the two OS X Handmade Hero projects that I had been maintaining. I originally created two projects to show how to write an OS X program with and without Xcode. However, most of the code between the two projects was identical and there was no real reason to continue as two separate projects. This combined repository allows you to develop either way. If you wwant to use Xcode, open the Handmade Hero Xcode project in the xcode subdirectory and build it as before. If you do not want to use Xcode, run 'make' from the code subdirectory and it should also work as before.

Compiling and Running

Once you clone or update this repository, copy (or clone, if you are using Casey's Github repository) Casey's .cpp and .h source files to the cpp/code subdirectory of this repository.

Also, copy over the test, test2, and test3 asset folders, and the intro_art.hha file to the data subdirectory of this repository.

Before you build the application for the first time, you need to create the packed asset files. To do this, run

make osx_asset_builder

and then execute the osx_asset_builder command line program. This will create the .hha files. From then on, you can just run 'make' from the code directory (Note: not the cpp/code directory!) to build the application bundle.

If you already have packed asset files, you can just copy them to the data subdirectory and skip building and running the osx_asset_builder.

You can then either run 'handmade' directly, or 'open Handmade.app'. The advantage of running 'handmade' directly is that debug console output (printf's, etc.) will be displayed in your terminal window instead of being logged to the System Console.

Hot-loading is supported, so you can just run 'make' again (or have your favorite editor do it) while the application is running to build and reload the newest code.

For better rendering performance using the software renderer, build the project in Release mode. You can also set the renderAtHalfSpeed flag in HandmadeView.mm to reduce the effective rendering rate to 30fps instead of the default 60fps. The proper Core Audio sound buffer size is automatically adjusted.

Author

Jeff Buck

The original version of Handmade Hero is being created by Casey Muratori.

osx_handmade's People

Contributors

itfrombit avatar

Watchers

 avatar

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.