gameprogcpp / code

Game Programming in C++ Code
Other
1.01k stars 354 forks source link

Cannot run on Mac OS Mojave #24

Closed yunfei-teng closed 5 years ago

yunfei-teng commented 5 years ago

Hi,

I am a very beginner of game design and was trying to run the codes in xcode of Mac OS, but got the following error

2019-01-24 22:12:41.254993-0500 Game-mac[5171:147185] [Game-mac] CGContextSetFillColorWithColor: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. 2019-01-24 22:12:41.255982-0500 Game-mac[5171:147185] [Game-mac] CGContextGetCompositeOperation: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. 2019-01-24 22:12:41.256014-0500 Game-mac[5171:147185] [Game-mac] CGContextSetCompositeOperation: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. 2019-01-24 22:12:41.256025-0500 Game-mac[5171:147185] [Game-mac] CGContextFillRects: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. 2019-01-24 22:12:41.256034-0500 Game-mac[5171:147185] [Game-mac] CGContextSetCompositeOperation: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Program ended with exit code: 0

Any idea for this please? Thank you.

chalonverse commented 5 years ago

In Mojave, Apple changed the way their OpenGL contexts work, I think. I believe I can fix this by updating the SDL library. I’ll push a change in a couple of hours that should fix this problem.

chalonverse commented 5 years ago

Ok, I've updated the SDL library. It appears to fix the issue on my Mac. Please let me know if you still have any issues with it.

yunfei-teng commented 5 years ago

It works. Thanks so much for such a wonderful material.