speaking of vs11...when I was moving my d3d11 code to it, I had some weird aligment issues with some of the XNA data types, like XMVECTOR. I somehow resolved them, but now when I try to make it work in vs10 again, I get similar problems
@EtiennedeMartel You need to create an NSWindow. You need to subclass NSOpenGLView and do the drawing in drawRect: and use the methods from NSResponder (which NSOpenGLView derives from) to handle events. Then add it to the window's contentView. That's about it.
while (true) { display.pump_events(); for (auto&& e : window1.events()) { ... } for (auto&& e : window2.events()) { ... } window1.make_current(); /* draw on window1 */ window1.swap_buffers(); window2.make_current(); /* draw on window2 */ window2.swap_buffers(); }
Or something like that.
@EtiennedeMartel Currently undefined. Springbok.Core will be standalone windowing and input only.
@EtiennedeMartel you should be able to set the current context using -[NSOpenGLContext makeCurrentContext] (with the context being the one from the NSOpenGLView) from the window.make_current() function.
OpenGL commands should work then.
That way, you don't need to override drawRect: and the user is in control.
Still not sure about events though, and making sure that the menu bar and the window controls respond.
@CatPlusPlus is it fine if that window1.make_current(); function is not thread safe?
@EtiennedeMartel Not strictly, but I haven't ever used anything else. :P
You also need to set up an NSAutoreleasePool somewhere before calling any other Objective-C methods, and you need to call [NSApplication sharedApplication] directly afterwards.
Cocoa doesn't poll for events as suggested, but instead its main thread goes to sleep. When an event arrives, the OS wakes up the thread and event processing resumes.
Okay, that will be a real pain in the fucking ass if you want to do it in the main thread.
Just a heads up, we're gonna have a super conductor turned up full blast and pointed at you for the duration of this next test. I'll be honest, we're throwing science at the walls here to see what sticks. No idea what it'll do.
@RadekdaknokSlupik you can respond to events from a separate thread and put them in a queue. When the user then polls events, it actually polls them from the queue.
Why does this crash? I did find out malloc() doesnt call constructors, so I called them myself manually, but it still crashes, I do not understand why.
PS. I know std::vector and new[] exists. Do not tell me to use vectors/new[] as an answer.
struct MyStruct {
vector<int> list;
};
voi...
@sehe I will join you fine gentlemen as soon as I make peace with my geom. culling implementation. Basically, all it has to do is give me the EVS a bit faster. Just a bit faster. So that my Codesoul™ is at rest.
I thought it was comprised mainly of attention whores and stalking wankers who passively earn Zuckerberg money while they're trying to gain access to their ex's newest photographs. Also, Zuckerberg's world domination with hoodies™, flip-flops™ and shit (probably a registered trademark).