Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Caanon

Member Since 08 Mar 2012
Offline Last Active Apr 03 2012 12:13 AM

Topics I've Started

PeekMessage(PM_NOREMOVE) + Fullscreen = fail?

01 April 2012 - 05:28 PM

Heya all

I'm following the DirectX tutorial here: [1]

I've found some strange behavior with the main loop... The tutorial uses the following

while(TRUE)
	{
		if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
		{
		  TranslateMessage(&msg);
			DispatchMessage(&msg);
			if(msg.message == WM_QUIT)
				break;
		}
		RenderFrame();
	}

When you hit alt-enter to switch to fullscreen mode, it works flawlessly. However, if you change the main loop to this:

while(TRUE)
	{
		if(PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
		{
			GetMessage(&msg, NULL, 0, 0);
			DispatchMessage(&msg);
			if(msg.message == WM_QUIT)
				break;
		}
		RenderFrame();
	}


When you hit alt-enter, it starts to go fullscreen, then "dings" an error and returns. It seems like it has to do with the PM_NOREMOVE flag, as the following shows the same broken behavior as the latter:


while(TRUE)
	{

		if(PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
		{

		}
		if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
		{
			DispatchMessage(&msg);
			if(msg.message == WM_QUIT)
				break;
		}
		RenderFrame();
	}

The DirectX debugging output doesn't give any errors or warnings. Interestingly, it has to do with the context switching itself, not the fullscreen... if you change the line:

swapChainDesc.Windowed = false;

It starts fine in fullscreen, but fails to switch out of fullscreen on alt-enter. Any reason why PM_NOREMOVE would break fullscreen switching?


[1] http://www.directxtu.../BA4.aspx#still

(New to XCode) Program runs find in XCode, fails at terminal window

08 March 2012 - 02:01 PM

Heya!

I'm very new to XCode's IDE so bear with me here. I've got two xcodeproj projects: A and B. A builds a framework, and B links to it via B->External Frameworks And Libraries->A.framework. Both are set to build to the $(PROJECT)/builds/Development directory, and do so successfully.

When I run B from within XCode after building it, it starts up successfully and runs. However, when I open a terminal and navigate to $(PROJECT)/builds/Development and run ./B, it fails with the error "dyld: Library not loaded: @executable_path/.../Frameworks/A.framework/Versions/A/A". Now, as far as I can tell, the only thing that can possibly change between the two settings (XCode vs Terminal) is some path environment variable that is set in XCode that isn't present in the Terminal.

So, a few questions:
1. Why would it successfully find the A framework when I run it from XCode, when there is no "Frameworks" folder anywhere inside side the project?
2. I have the "Framework Search Paths" set up for $(PROJECT)/builds/Development, but it doesn't seem to do anything. Is that only for building?
3. Does setting A's "Dynamic Library Install Name" to something like "@executable_path/.../Frameworks" require that any executable that uses it be located relative to it? It seems a little backwards to require that the app be located relative to the framework. On Linux, you'd install the library to /usr/local/lib and the executable anywhere you'd want, ya?

Thanks!

PARTNERS