Registering window movement

Apprentice
Posts: 9
Joined: 2007.04
Post: #1
I just finished a computer animation course wherein I was introduced to GLUT using C. GLUT has a fairly wide assortment of input callbacks, but I haven't found a way to get live updating of the window's current position as it is dragged around by the user. What is the easiest way to get this information?

I should also mention that I have no C++ or Carbon programming experience.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
glutGet(GLUT_WINDOW_X) and _Y will tell you where the window is. It doesn't look like GLUT has a callback to tell you when the window was moved, though, so you'd need to check every frame.

Why on earth do you need to know?
Quote this message in a reply
Apprentice
Posts: 9
Joined: 2007.04
Post: #3
I want to do something like this (8.2 MB), but with a particle system to simulate water. The above was fairly easy to put together with Unity, but Unity is slow and doesn't really do particle interactions.
Quote this message in a reply
Apprentice
Posts: 9
Joined: 2007.04
Post: #4
Ok, I tried using a timer function to measure the window movement. The problem is that the timer is suspended by window movement. I really need live updating. Does this rule out GLUT?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
your display function or idle function might continue to fire during window movement...

otherwise, yes, it'll rule out GLUT. Most things do, in the end.
Quote this message in a reply
Apprentice
Posts: 9
Joined: 2007.04
Post: #6
That is unfortunate. I need the timer function to fire while the window is being moved anyway. So where do you suggest I look next?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #7
Depends what you're after. For cross-platform work, SDL might do what you need, or might not. You'd have to try it on each platform and see. Otherwise, you're left writing some Cocoa code yourself.
Quote this message in a reply
Apprentice
Posts: 9
Joined: 2007.04
Post: #8
I'm interested in learning Cocoa anyway. What API would you suggest I use for graphics in Cocoa?
Quote this message in a reply
Moderator
Posts: 713
Joined: 2002.04
Post: #9
Muriac Wrote:I'm interested in learning Cocoa anyway. What API would you suggest I use for graphics in Cocoa?

OpenGL, just what you were using with GLUT Wink

Mark Bishop
--
Student and freelance OS X & iOS developer
Quote this message in a reply
Apprentice
Posts: 9
Joined: 2007.04
Post: #10
Of course, that makes sense. But how will I draw solid teapots? Wink
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #11
Muriac Wrote:Of course, that makes sense. But how will I draw solid teapots? Wink

1 way is using GLUT, just call the glutSolidTeapot function
another find an obj version of it and load then display that.

also ill mention that I have an xcode template here for cocoa opengl which may be useful.

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Apprentice
Posts: 9
Joined: 2007.04
Post: #12
Says Xcode:
Quote:~/Desktop/Cocoa OpenGL Application/CocoaApp.xcodeproj cannot be opened because the project file cannot be parsed.
Quote this message in a reply
impeacefull
Unregistered
 
Post: #13
Mad omfg!!!
i can not play ccs cause it says that master game server is not connectedkMad Mad Bored Cry
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  glutWarpPointer lag and fps movement Ropeburn 3 8,975 Jan 18, 2011 09:47 PM
Last Post: OneSadCookie
  3d Space Sensing movement? wonza 6 4,868 Dec 19, 2008 08:19 PM
Last Post: wyrmmage
  AI/Movement wonza 6 5,726 Nov 26, 2008 10:23 AM
Last Post: wonza
  simple Question about movement bonanza 3 4,322 Oct 17, 2007 11:12 AM
Last Post: bonanza
  Slower Movement Nick 7 5,280 Aug 27, 2004 02:15 PM
Last Post: Josh