discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNUstep for games


From: Ivan Vučica
Subject: Re: GNUstep for games
Date: Tue, 15 Jul 2014 18:03:36 +0100

[The rest of the response presumes you're explicitly interested in working with Objective-C.]

Why not just draw with OpenGL into an NSOpenGLView?

I'm not sure I'd go with anything animated, not necessarily because it wouldn't work or be performant enough, but because -- why risk it?

Just use a single NSTimer to drive the frame redraw into NSOpenGLView. With SDL and most other frameworks where you control the main loop, you'd have an infinite loop which may or may not sleep upon frameswap, then you'd measure time passed. Under OS X, you'd have CADisplayLink. But if you're using NSOpenGLView under GNUstep, as far as I know your best bet is still using NSTimer.

Idea:
-(void) frame
{
  [self draw];
  NSTimeInterval delta_t = [self timeSinceLastFrame];
  [self update: delta_t];
}

Some more thoughts: For a fullscreen game, there aren't many benefits of using AppKit under non-OS X platforms, on the contrary. Benefits are primarily with non-animated buttons and with 'generic-looking' text entry. But if you're doing windowed stuff, you're suddenly blessed with menus as well.

Your choice should definitely be only between SDL and AppKit. And this choice depends only on whether you're going to go fullscreen and whether you'd like to use pre-made UI widgets. For the game content itself, you should do your painting with OpenGL (even for text labels), at which point your use of Foundation should be the same no matter what framework controls your main loop.


On Mon, Jul 14, 2014 at 2:48 AM, Germán Arias <address@hidden> wrote:
Hi,

I want experiment with games, my question is if is enough (in performance) using NSImages, NSTimers, NSAnimations... to build the game, or is better if I use something like SDL. The links below show examples of games I have in mind. I appreciate any advice.

http://img.youtube.com/vi/ts3zQ3GObVk/0.jpg
http://images.mob.org/androidgame_img/inotia_4/real/7_inotia_4.jpg

Thanks.
Germán.


_______________________________________________
Discuss-gnustep mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnustep



--
Ivan Vučica
address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]