Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Dissipate

Member Since 31 Oct 2012
Offline Last Active Yesterday, 09:56 PM
-----

Posts I've Made

In Topic: ID3DXLine and LPD3DXFONT garbled in windowed mode fine in Fullscreen

20 April 2013 - 12:17 PM

Thanks for the super speedy reply.

I have squashed my fullscreen image into my windowed form. Which is what I wanted. Heres my code:

if(m_D3DPP.Windowed) 
	return;

RECT ClientRect = {0, 0, WINDOWED_WIDTH, WINDOWED_HEIGHT};
AdjustWindowRect(&ClientRect, WS_OVERLAPPEDWINDOW, false);
m_D3DPP.BackBufferFormat = D3DFMT_UNKNOWN;
m_D3DPP.BackBufferWidth  = FULLSCREEN_WIDTH;
m_D3DPP.BackBufferHeight = FULLSCREEN_HEIGHT;
m_D3DPP.Windowed         = true;
	
SetWindowLongPtr(m_hWindow, GWL_STYLE, WS_OVERLAPPEDWINDOW);

SetWindowPos(m_hWindow, HWND_TOP, 
			100, 100, 
			ClientRect.right, ClientRect.bottom, 
			SWP_NOZORDER | SWP_SHOWWINDOW | SWP_FRAMECHANGED);

Here is a partial shot of the problem:

2013-04-20_190313_zps2ad0b978.png

 

Am I windowing the correct way? It works though. I want to be keep showing the squashed screen in windowed form. Maybe I just have to put up with it? Or I could use my own bitmapped fonts...?


In Topic: Exit fullscreen - window displays non contained resolution

11 April 2013 - 02:24 PM

Thanks for you reply...

Try using SWP_FRAMECHANGED with SetWindowPos.

Didn't work. No change.

Also, what do you mean it doesn't contain the entirety of the display?

When exiting fullscreen the window displays cropped tiled image. The top left of the background which extends right and down beyond the window which is 1280x720. So the backbuffer must be 1920x1080.

Is the rendered image cropped or stretched?

Not stretched in anyway. Just cropped.

Are you messing around with viewports?

No. I did read somewhere on MSDN about viewport but I'm unsure how to implement them. I had a go and failed.

Do you properly update the camera's projection matrix to compensate for the size change?

If I use my Camera->Update() to set the projection and view it does work fine (I just plug the same old numbers in). But, Im trying to create a 2D game and I dont bother calling it in the reder loop or anywhere else. This draws the tiles absolutely rather than relative.

Check, say, when the mouse is clicked, that the back buffer size matches the client area size after coming out of fullscreen.

***Solved*** (Sigh...) I was setting the backbuffer to the windowed_width&height along with the ClientRect. Changed it to fullscreen_width&height and it works like a charm. (althought I dont believe in charms!...)

 

Thank you for giving me guiding me to the answer. May many doughnuts come your way...!


In Topic: Your username is now the title of your game. Please describe your game and th...

11 April 2013 - 09:37 AM


Onward and advance the kingdom... for space is the capacious frontier. You are a bundle of gases. fly, float and flee through dangerous territory as you out wit your arch enemy as he tries to dissolve you. For nothing can 'contain' you that you cannot break out of. And the princess need saving. But soft, what light through yonder 'window' breaks? It is the east, and Juliet is the sun. Such calamity to ever put these two together. Can you defuse the situation before you diffuse into oblivion?

Controls:
Hold Space to hold together molecular cohesion and draw in surrounding gases. When max power is reached, release to unleash the power that is within in one almighty explosion... end of game. End of computer. Watch the smoke rise as the story begins afresh.
 


In Topic: Save Level causes a freeze. Mouse click unfreezes

22 February 2013 - 07:18 PM

** SOLVED **

 

Resolution: F10 causes the window to do something. I tried F2 and it works fine.

Reason: This thread explains why and other better ways to overcome.

 

Thanks everyone for your valuable and speedy input *(iCheesyGrin)


In Topic: Cloned Texture not displayed with Linked List

28 January 2013 - 06:25 PM

Posted 24 January 2013 - 05:49 PM

DeleteAllNodes definitely contains a bug, it fails to clear the "head" and "tail" pointers. CNode calls "delete" on a VOID pointer, which is undefined. You should use templates to maintain type safety. The destructor does not deallocate memory.
The lack of copy constructors and assignment operators on the two classes is also problematic. You need to obey the rule of three, or "disable" copying and assignment by declaring the copy constructor and assignment operator as private, and not implementing them.
I don't see any other major bugs, but due to the unencapsulated implementation every single client access needs to be perfectly correct or it could corrupt the loop.
There are a few minor issues too:
(m_uNodeType != CNODE_HEAD) || (m_uNodeType != CNODE_END) is a tautology. Consider, if X is any number, then (X != 1) || (x != 2) is true.
You don't need to check a pointer is NULL before calling delete - delete does the right thing with null pointers and you are duplicating those checks.
You don't need to have two value nodes in the linked list. Most implementations just have a pair of pointers to nodes. Using such "sentinel" nodes isn't necessarily a bad thing, it is a valid implementation strategy, but you should not force client code to reason about this.
You don't need the "node type" concept. Just have the head and tail contain NULL data pointers.
Don't depend on Windows.h: just use void * rather than VOID * if it was necessary
Use an enum rather than #defines for something like "node type", if it was necessary
Main.h is almost always a poor idea.
In general, strive for as few dependencies as possible, particularly for something generic like a linked list. Avoid coupling this implementation to the rest of your project



I have made all the changes you suggested, making a Circular, templated, doubley linked list and applying the rule of three. Implementing this into my project and utilising it does not solve the problem (I'll research dynamic arrays later!). Please can you help me understand whats happening as I can't continue otherwise. Maybe someone can post a short excerpt/code-list on how to clone and draw a textured quad. My D3DXSprite clones fine.
(hoping...!)

PARTNERS