Hey guys! Whilst planning to port my engine(http://www.youtube.com/user/LunarSanity?feature=mhee) to Mac I decided to run a test. Not only am I planning to port it to Mac but to port the C++ code over to Objective-C and compile using GNUstep when I'm on Windows(I like Objective-C).
Jun 10 17:36:37 Marc-Reeds-MacBook-Pro-2.local Test[799] <Error>: kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection
Jun 10 17:36:37 Marc-Reeds-MacBook-Pro-2.local Test[799] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Jun 10 17:36:37 Marc-Reeds-MacBook-Pro-2.local Test[799] <Error>: kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection
Jun 10 17:36:37 Marc-Reeds-MacBook-Pro-2.local Test[799] <Error>: kCGErrorInvalidConnection: CGSNewWindowWithOpaqueShape: Invalid connection
2011-06-10 17:36:37.761 Test[799:60b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error (1002) creating CGSWindow on line 262'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff96763216 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff9614ca2e objc_exception_throw + 43
2 CoreFoundation 0x00007fff9676304a +[NSException raise:format:arguments:] + 106
3 CoreFoundation 0x00007fff96762fd4 +[NSException raise:format:] + 116
4 AppKit 0x00007fff8f2bf084 _NSCreateWindowWithOpaqueShape2 + 788
5 AppKit 0x00007fff8f254749 -[NSWindow _commonAwake] + 1845
6 AppKit 0x00007fff8f250ebc -[NSWindow _commonInitFrame:styleMask:backing:defer:] + 1871
7 AppKit 0x00007fff8f24fbd6 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1502
8 AppKit 0x00007fff8f24f5f2 -[NSWindow initWithContentRect:styleMask:backing:defer:] + 47
9 SDL 0x000000010055be1d SDL_SoftStretch + 24461
10 SDL 0x000000010055a57d SDL_SoftStretch + 18157
11 SDL 0x000000010054f043 SDL_SetVideoMode + 595
12 Test 0x0000000100523dc8 main + 152
13 Test 0x0000000100523d24 start + 52
14 ??? 0x0000000000000001 0x0 + 1
)
terminate called throwing an exceptionAbort trap: 6
NOTE: I have no experience with Cocoa or any Mac Windowing APIs as such.
Anyone know what's wrong???
I love 16-bit Assembly language programming. I'm currently having an affair with C++. I'm working on a 2D Game Engine called Lunar Sanity for PC and soon DC. I own three games consoles: Dreamcast, Xbox 360 and Atari Flashback. I'm on a Mac and soon a PC. I love Windows XP as it works great(can run 16-bit GUIs). I've been programming for 3 years(since I was 11).
I settling into my hybrid(procedural&object orientated) life. It's all good so far.
Test.m: In function ‘main’:
Test.m:9: error: ‘NSApplication’ undeclared (first use in this function)
Test.m:9: error: (Each undeclared identifier is reported only once
Test.m:9: error: for each function it appears in.)
I'm presuming I have to create an instance of NSApplication then pass the message to that?
I love 16-bit Assembly language programming. I'm currently having an affair with C++. I'm working on a 2D Game Engine called Lunar Sanity for PC and soon DC. I own three games consoles: Dreamcast, Xbox 360 and Atari Flashback. I'm on a Mac and soon a PC. I love Windows XP as it works great(can run 16-bit GUIs). I've been programming for 3 years(since I was 11).
I settling into my hybrid(procedural&object orientated) life. It's all good so far.
Thanks dude! My bad, your code worked it's just I didn't import the Cocoa header also I didn't link. Now it works.
By the way what does that message to NSApplication actually do? Is it a class method?
I love 16-bit Assembly language programming. I'm currently having an affair with C++. I'm working on a 2D Game Engine called Lunar Sanity for PC and soon DC. I own three games consoles: Dreamcast, Xbox 360 and Atari Flashback. I'm on a Mac and soon a PC. I love Windows XP as it works great(can run 16-bit GUIs). I've been programming for 3 years(since I was 11).
I settling into my hybrid(procedural&object orientated) life. It's all good so far.
VoidElite wrote:Thanks dude! My bad, your code worked it's just I didn't import the Cocoa header also I didn't link. Now it works.
By the way what does that message to NSApplication actually do? Is it a class method?
The Apple Developer site is very good. Its got tons of samples and tutorial on top of the the Docs.
You can access all this information through Xcode's help as well.
Apple Developer Docs wrote:
The sharedApplication class method initializes the display environment and connects your program to the window server and the display server. The NSApplication object maintains a list of all the NSWindow objects the application uses, so it can retrieve any of the application’s NSView objects. sharedApplication also initializes the global variable NSApp, which you use to retrieve the NSApplication instance. sharedApplication only performs the initialization once; if you invoke it more than once, it simply returns the NSApplication object it created previously.
VoidElite wrote:Thanks dude! My bad, your code worked it's just I didn't import the Cocoa header also I didn't link. Now it works.
By the way what does that message to NSApplication actually do? Is it a class method?
The Apple Developer site is very good. Its got tons of samples and tutorial on top of the the Docs.
You can access all this information through Xcode's help as well.
Apple Developer Docs wrote:
The sharedApplication class method initializes the display environment and connects your program to the window server and the display server. The NSApplication object maintains a list of all the NSWindow objects the application uses, so it can retrieve any of the application’s NSView objects. sharedApplication also initializes the global variable NSApp, which you use to retrieve the NSApplication instance. sharedApplication only performs the initialization once; if you invoke it more than once, it simply returns the NSApplication object it created previously.
Thankyou! I shall live on that documentation from now on. Is there like a Apple Developer documentation app for iOS? Just for quick reference. Or maybe a book that just contains all that?
I love 16-bit Assembly language programming. I'm currently having an affair with C++. I'm working on a 2D Game Engine called Lunar Sanity for PC and soon DC. I own three games consoles: Dreamcast, Xbox 360 and Atari Flashback. I'm on a Mac and soon a PC. I love Windows XP as it works great(can run 16-bit GUIs). I've been programming for 3 years(since I was 11).
I settling into my hybrid(procedural&object orientated) life. It's all good so far.
VoidElite wrote:Hey guys! Whilst planning to port my engine(http://www.youtube.com/user/LunarSanity?feature=mhee) to Mac I decided to run a test. Not only am I planning to port it to Mac but to port the C++ code over to Objective-C and compile using GNUstep when I'm on Windows(I like Objective-C).
May I be so much of an asshole as to inquire why? Why are you porting C++ code to Objective-C, when it will work perfectly fine as-is and interface without an issue to any Mac-required Objective-C?
I'm just curious as to why you have chosen to put yourself through that. If it's to learn Objective-C, go for it. I'm just making sure you aren't misinformed regarding C++ support on OSX/iOS and C++/Objective-C interoperability.
VoidElite wrote:Hey guys! Whilst planning to port my engine(http://www.youtube.com/user/LunarSanity?feature=mhee) to Mac I decided to run a test. Not only am I planning to port it to Mac but to port the C++ code over to Objective-C and compile using GNUstep when I'm on Windows(I like Objective-C).
May I be so much of an asshole as to inquire why? Why are you porting C++ code to Objective-C, when it will work perfectly fine as-is and interface without an issue to any Mac-required Objective-C?
I'm just curious as to why you have chosen to put yourself through that. If it's to learn Objective-C, go for it. I'm just making sure you aren't misinformed regarding C++ support on OSX/iOS and C++/Objective-C interoperability.
I just like the look of Objective-C syntax to be honest.
I am well aware that C/C++/Objective-C are all multi-platform.
I love 16-bit Assembly language programming. I'm currently having an affair with C++. I'm working on a 2D Game Engine called Lunar Sanity for PC and soon DC. I own three games consoles: Dreamcast, Xbox 360 and Atari Flashback. I'm on a Mac and soon a PC. I love Windows XP as it works great(can run 16-bit GUIs). I've been programming for 3 years(since I was 11).
I settling into my hybrid(procedural&object orientated) life. It's all good so far.
VoidElite wrote:Thanks dude! My bad, your code worked it's just I didn't import the Cocoa header also I didn't link. Now it works.
By the way what does that message to NSApplication actually do? Is it a class method?
The Apple Developer site is very good. Its got tons of samples and tutorial on top of the the Docs.
You can access all this information through Xcode's help as well.
Apple Developer Docs wrote:
The sharedApplication class method initializes the display environment and connects your program to the window server and the display server. The NSApplication object maintains a list of all the NSWindow objects the application uses, so it can retrieve any of the application’s NSView objects. sharedApplication also initializes the global variable NSApp, which you use to retrieve the NSApplication instance. sharedApplication only performs the initialization once; if you invoke it more than once, it simply returns the NSApplication object it created previously.
Thankyou! I shall live on that documentation from now on. Is there like a Apple Developer documentation app for iOS? Just for quick reference. Or maybe a book that just contains all that?
VoidElite wrote:Hey guys! Whilst planning to port my engine(http://www.youtube.com/user/LunarSanity?feature=mhee) to Mac I decided to run a test. Not only am I planning to port it to Mac but to port the C++ code over to Objective-C and compile using GNUstep when I'm on Windows(I like Objective-C).
May I be so much of an asshole as to inquire why? Why are you porting C++ code to Objective-C, when it will work perfectly fine as-is and interface without an issue to any Mac-required Objective-C?
I'm just curious as to why you have chosen to put yourself through that. If it's to learn Objective-C, go for it. I'm just making sure you aren't misinformed regarding C++ support on OSX/iOS and C++/Objective-C interoperability.
I just like the look of Objective-C syntax to be honest.
I am well aware that C/C++/Objective-C are all multi-platform.
I use a Mac... but I'll be dammed if I use Objective-C for my game engine...
VoidElite wrote:Hey guys! Whilst planning to port my engine(http://www.youtube.com/user/LunarSanity?feature=mhee) to Mac I decided to run a test. Not only am I planning to port it to Mac but to port the C++ code over to Objective-C and compile using GNUstep when I'm on Windows(I like Objective-C).
May I be so much of an asshole as to inquire why? Why are you porting C++ code to Objective-C, when it will work perfectly fine as-is and interface without an issue to any Mac-required Objective-C?
I'm just curious as to why you have chosen to put yourself through that. If it's to learn Objective-C, go for it. I'm just making sure you aren't misinformed regarding C++ support on OSX/iOS and C++/Objective-C interoperability.
I just like the look of Objective-C syntax to be honest.
I am well aware that C/C++/Objective-C are all multi-platform.
I use a Mac... but I'll be dammed if I use Objective-C for my game engine...
Ditto. And I was a little more confused by the fact that he looked interested in DC development judging by his signature (so it's not like he's going to be porting an Obj-C engine there any day). But to each his own.