discuss-gnustep
[Top][All Lists]
Advanced

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

Re: GNUstep for games


From: Germán Arias
Subject: Re: GNUstep for games
Date: Wed, 16 Jul 2014 13:12:11 -0600
User-agent: GNUMail (Version 1.2.1)

Hi,

On 2014-07-15 11:03:36 -0600 Ivan Vučica <ivan@vucica.net> wrote:

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

right

> 
> Why not just draw with OpenGL into an NSOpenGLView?

Are you saying that, for example, if I need draw a image I should use OpenGL 
instead NSImage?

> 
> 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?

Not sure if I will need animations. Maybe to rotate some images.

> 
> 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.
> 
> 

My idea is fullscreen, but a windowed option would be nice. I don't want UI 
elements (buttons, menu ...) in the game. Just the game.

I will do some test maybe at weekend. 

Thanks.
Germán.




reply via email to

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