Screen-Smash - Test My Game!!!

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
thetoddfather
Posts: 338
Joined: October 1st, 2012, 9:53 pm
Location: Canada

Re: Screen-Smash - Test My Game!!!

Post by thetoddfather » November 3rd, 2012, 2:06 am

Asimov, Lux,

Either, a) I am just plain crappy with google and finding answers to the great mystery that is full-screen in winapi orrrr
b) it's not as obvious to find those answers as you might think. Reason I went with this work around was that reason alone. I'd love to make it 'real' fullscreen and I can promise I have searched this stuff. Only answers I found led me to this stretched window cause apparently you have to go into some dev mode in windows to get access to true fullscreen and my attempts at that were, ummmm, messy.

The worst part is I bet this is an easy fix. But I've been digging for over a week and best I can find is info on resizing windows and making windows do certain things like be on top and stuffs.

Asimov, I am clueless when it comes to the art side of thngs. I know my way around photoshop, ish, but that's where my ability ends. I have a friend that works in the industry as an artist, but I doubt I'd get much useful advice out of him on making fire look decent. When you get some free time, help me out with making some cool fire effects instead of modelling me a zippo ;)

For now, it's one, sad little four frame fire sprite that'll have to do the trick.

User avatar
thetoddfather
Posts: 338
Joined: October 1st, 2012, 9:53 pm
Location: Canada

Re: Screen-Smash - Test My Game!!!

Post by thetoddfather » November 3rd, 2012, 2:44 am

Asimov,

This changes things yet again, but does not go into devmode. Still window'd. Probably still the same, but it uses system metrics to find your settings and make the window. Still going to have to dive into this devmode now and get my hands dirty, but try this, it might work.

User avatar
thetoddfather
Posts: 338
Joined: October 1st, 2012, 9:53 pm
Location: Canada

Re: Screen-Smash - Test My Game!!!

Post by thetoddfather » November 3rd, 2012, 3:35 am

This is what I am quite sure is true full-screen mode using devmode, and I actually got it working....

If the last one don't fix it, THIS should.

;)
Last edited by thetoddfather on November 4th, 2012, 8:45 pm, edited 1 time in total.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Screen-Smash - Test My Game!!!

Post by chili » November 3rd, 2012, 4:13 am

Fullscreen isn't a WinAPI thing; it's a Direct3D thing. I challenged the board members to figure it out, and one of them did. I *think* it was walka, and he posted his code.
Chili

User avatar
thetoddfather
Posts: 338
Joined: October 1st, 2012, 9:53 pm
Location: Canada

Re: Screen-Smash - Test My Game!!!

Post by thetoddfather » November 3rd, 2012, 7:27 am

Thanks for putting me at least on the right track, at least I got true full-screen from your advice. Quite easy once I got your help.

And, at least that much of this cypher is decoded. Got me on the right track, but with an all new bag of problems and it's just not working. Guess when you load fullscreen with directx it just discards your cursors. So, now I have this. Spent around 5 hours straight attempting to understand where my cursors have gone.

So yahh, DirectX is fun... Cause all I've searched out seems to amount to zeroooo.

WM_SETCURSOR does zero. Tried somewhere in the region of 30 different ways to reload my old resource icons with 100% no effect what-so-ever, other than my computer crashing.

So, back to the old way, sorry Asimov.
Last edited by thetoddfather on November 4th, 2012, 8:45 pm, edited 1 time in total.

User avatar
thetoddfather
Posts: 338
Joined: October 1st, 2012, 9:53 pm
Location: Canada

Re: Screen-Smash - Test My Game!!!

Post by thetoddfather » November 3rd, 2012, 7:30 am

icons = cursors.

User avatar
thetoddfather
Posts: 338
Joined: October 1st, 2012, 9:53 pm
Location: Canada

Re: Screen-Smash - Test My Game!!!

Post by thetoddfather » November 3rd, 2012, 8:17 pm

I am still trying to figure this out here.

Based on what I'm reading, fullscreen mode isn't compatible with hardware cursors, and there seems no way of forcing them. This means having to use the directx routines, which I'm trying to figure out.

Tried this, didn't seem to change anything.

Code: Select all

gfx.pDevice->SetCursorPosition(mouse.GetMouseX(),mouse.GetMouseY(),D3DCURSOR_IMMEDIATE_UPDATE );
gfx.pDevice->ShowCursor(TRUE);
It seems I need to use these funcitons because my cursors are resource files.

Code: Select all

HRESULT D3DXLoadSurfaceFromResource(
  _In_     LPDIRECT3DSURFACE9 pDestSurface,
  _In_     const PALETTEENTRY *pDestPalette,
  _In_     const RECT *pDestRect,
  _In_     HMODULE hSrcModule,
  _In_     LPCTSTR pSrcResource,
  _In_     const RECT *pSrcRect,
  _In_     DWORD Filter,
  _In_     D3DCOLOR ColorKey,
  _Inout_  D3DXIMAGE_INFO *pSrcInfo
);
iDirect3DDevice9->SetCursorProperties(0, 0, surface));
The third param in SetCursorProperties needs to be a Pointer to an IDirect3DSurface9 interface. This parameter must point to an 8888 ARGB surface (format D3DFMT_A8R8G8B8).

I'm a little, and by a little I mean a whoooolllllee lot, confused about how to go about loading my resource files to this format surface, then create a pointer to that surface and pass it to SetCursorProperties. Not even sure if that will solve this issue either.

Currently I am using a slightly modified method to how the framework loads its cursor with/

Code: Select all

HCURSOR hamCur2 = (HCURSOR)LoadImage(hInst,MAKEINTRESOURCE(IDC_HIT_CURSOR),IMAGE_CURSOR ,256,256,LR_CREATEDIBSECTION);
They are 32 bit images @ 256x256.

Kinda at a loss on how to proceed and there is precious little online for seeing how others have implimented this with any success. :roll:

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Screen-Smash - Test My Game!!!

Post by LuX » November 3rd, 2012, 8:42 pm

Why don't you just load the cursor as a normal image?
ʕ •ᴥ•ʔ

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Screen-Smash - Test My Game!!!

Post by Asimov » November 3rd, 2012, 9:01 pm

Hi Todfather,

In my game I use animated sprites as cursors. I assumed this is what you are doing?
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
thetoddfather
Posts: 338
Joined: October 1st, 2012, 9:53 pm
Location: Canada

Re: Screen-Smash - Test My Game!!!

Post by thetoddfather » November 3rd, 2012, 10:28 pm

Lux, I'm not sure what you mean? Just use an image loaded and the print it every frame? That's sort of how I did the flame over the lighter, which is why it's currently the only thing showing up, however there's a fair bit of lag as you move around on the screen. And that would mean having all my cursor files now sitting in the directory, cause I don't know how to take these existing cursor files and transfer the image data to a bmp or surface.

Asimov, no, ideally I would just like to use my existing cursors, however, switching to fullscreen in order to solve the issues you had has made them disappear. If I used animated sprites there would still be that lag I assume. So are you currently just taking an animated sprite and printing it every frame at mouse xy?

In any event, the custom cursors I've made in my resource file are what I'd like to put on the screen. I have no idea how to take that resource info and create a surface with that cursor image on it.

Sucks that they didn't allow you to keep your cursor in fullscreen. Doesn't make sense to me. Worked fine in windowed mode stretched to fullscreen dimensions, why kill it for true fullscreen and force you to create new ones using surface pointers and crap. From what I've read they are difficult to make look good and often flicker. AND you have to update its location constantly. I'm sure there was a reason, but kinda sucks. Think if I can't figure out some way to do this here I'll have to go back to the old way, which also kinda blows.

Post Reply