Jump to content
  • Advertisement
Sign in to follow this  
GuyWithBeard

Creating a window and message pump in OS X without SDL or SFML

This topic is 2102 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

 

I am looking into porting my game engine to OS X in the near future. Currently it is a Windows-only engine where I create my window using the Win32 API. I have looked a bit into how people are doing the same in OS X, but I have not really found anything that suits my needs. Basically I need to drive the main loop myself and pump messages at a certain point in the main loop. Most of the stuff I have found is about running a Cocoa application which calls an update function at given intervals, but that does not fly with my engine.

 

I could use SDL or SFML, but those are very large libraries and I already have code for doing almost everything else I need. If I could just extract the window creation and message handling I could use them, but I would not want to link to the entire SDL just to have it create my window.

 

TLDR: How do I create a window and pump messages on OS X without using bloated libraries like SDL, and while still driving the complete main loop myself?

 

Thanks!

Edited by GuyWithBeard

Share this post


Link to post
Share on other sites
Advertisement

I haven't used SDL, but you do know that SFML is modular, right? You can simply include the System and Window modules and completely skip the Graphics, Networking, and Audio modules if you wanted.

Share this post


Link to post
Share on other sites

Right, I did not know that. It seems the SFML window wants to handle input as well, which is not something I want, but maybe that can be disabled.

 

That said, I am still a little hesitant to bring in another complete library for this. Doing it with plain Cocoa or Carbon would be better. Though, Carbon might not be 64-bit compatible, I don't know...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!