# jtza8

Member

6

100 Neutral

• Rank
Newbie

2. ## Full Screen OpenGL in Cocoa

I've been trying to create a full screen window which houses an NSView on which OpenGL is rendered, which appears to be the standard way of doing things in Mac OS 10.6+. After switching display modes, using Quartz (i.e. CGCaptureAllDisplayModes and CGDisplaySetDisplayMode) I'm left with a black screen and the mouse cursor. Seems like I'm switching out of the window-manager this way. Any links/clues on what I should do to draw an existing OpenGL context to a full screen view using an alternate display mode? Help would be much appreciated, for which I also thank you greatly in advance.
3. ## Preserving Textures

Thanks, FXACE, that helped.
4. ## OpenGL Preserving Textures

I just want to be sure I understand this correctly, but I'm pretty sure that switching between window and fullscreen modes creates a new OpenGL context, and thus I loose all my textures. If I want to re-use textures, the best I can do is reload their tex-image data once I've switched video modes? ... or is there a better way? Any help in knowing whether I'm right will be much appreciated. As will any advice.
5. ## Time-based Collision Detection

I've been building my own physics engine to try out an idea that I have. Instead of using spacial collision detection (namely, moving objects and then checking whether they overlap) I've decided to try time-based collision detection (predicting when collisions could occur based on displacement, velocity and acceleration; and then moving objects). To collide two points, where point A and B have physical properties with 1d vectors, their time of collision can be calculated with the following variables: Note that as long as two 1d points move, there will always be a collision time, whether positive or negative. After manhandling the following equations of motion and observing the resulting equations behaviour: ... you get the following equation: This concept can then be expanded to determine the length and duration for 1d segment collision which then represent a segment of time, namely the entry time and exit time of the collision. Using this, you can determine the exact collision time for convex polygons by using the SAT (with time-segments rather than space-segments). Once you've calculated the nearest collision for each object, you can calculate the motion for each object, knowing when a collision will occur and handling it accordingly. I'm still figuring out whether this method might be usable with rotation (which I haven't researched yet), and I only have high-school level maths. Since I don't know of any resources about this so far, it would be helpful if someone could provide me a link to some similar concepts. My implementation isn't complete yet, and as this is my own idea, there's still a lot of refactoring, etc. which needs to be done, so any ideas that anyone reading this could contribute at all would be greatly appreciated. Just thought I'd put this out here, and see how people respond... if anyone responds, that is... I hope some of this is useful.