Jump to content

  • Log In with Google      Sign In   
  • Create Account

Sh@dow

Member Since 02 Sep 2009
Offline Last Active Oct 16 2014 09:18 AM

Posts I've Made

In Topic: How object coordinates are tracked in game engines?

15 October 2014 - 06:10 AM

Thanks to all for reply,

 

I'm using some sort of bounding cube to detect collisions but the vertexes of that cube must be transformed.

I'm thinking how to transform that vertexes. 

GLM library seems to calculate matrices on using shaders so it is impossible to get result from it.


In Topic: [DX8] GetDeviceState for joystick

03 August 2011 - 12:59 AM

I found that the problem is in delay between Acquire and GetDeviceState. When no delay is used the buttons are not read. When delay is 50ms or more the button state is returned correctly. I think hardcoded delay value is not a good idea. Cause it can vary from driver to driver. How could i select a proper one?

In Topic: Problem with Tabbed window (sources included)

13 September 2010 - 07:07 AM

Hi AverageMidget, thanks for your reply.
I changed the code and the bug disappeared. After i wrote first post i found another way how to fix it: i changed

DeferWindowPos(hdwp,displaytab, HWND_TOP, rc.left+crect.left, rc.top+crect.top,
rc.right - rc.left, rc.bottom - rc.top,0)
to

SetWindowPos(displaytab,0,rc.left+crect.left,rc.top+crect.top,rc.right - rc.left,rc.bottom - rc.top,0);

seems very strange but it works.


In Topic: Handling WM_RBUTTONUP message in ListView

30 July 2010 - 09:15 AM

My goal is to create a list view, which would be easy to use, and which could be managed using class methods.
As we know when event occurs list view sends a message to a parent window.So the parent window must define the list's view reaction to external events.
This situation does not suits me because the code is becoming scattered and less reusable.I want list view to handle all events,manage popup menus.Parent window must not know about any list view existence.
So i subclassed list view window procedure to handle events before they processed to the parent window.As was noticed before it is impossible to handle WM_RBUTTONUP message even in subclassed procedure. I noticed that it is impossible to capture "right mouse button up" message with WM_NOTIFY/NM_RCLICK message.WM_CONTEXTMENU message solved the problem. Is is sent anytime the right mouse button goes up in the window. The only inconvenience is thatr it is necessary to check whether item is selected/focused or not and how many items are selected.My code for that is as follows:

case WM_CONTEXTMENU:
{
int sm = SendMessage(object->listviewhandle,LVM_GETSELECTIONMARK,0,0);
if(sm!=-1) //some items are selected or focused
{
int selcount = SendMessage(object->listviewhandle,LVM_GETSELECTEDCOUNT,0,0);
if(selcount>1) break; //if more than one selected don't track
//cheking if selected
int fm = SendMessage(object->listviewhandle,LVM_GETITEMSTATE,sm,LVIS_FOCUSED|LVIS_SELECTED);
int b = LVIS_SELECTED;
if( (fm&LVIS_SELECTED)!=0) //is selected
{
POINT cpos;
GetCursorPos(&cpos);
TrackPopupMenu(object->popupselmenu,TPM_LEFTALIGN,cpos.x,cpos.y,0,object->listviewhandle,0);
break;
}
else //maybe focused?
{
if( (fm&LVIS_FOCUSED )!=0) //is focused
{
POINT cpos;
GetCursorPos(&cpos);
TrackPopupMenu(object->popupnoselmenu,TPM_LEFTALIGN,cpos.x,cpos.y,0,object->listviewhandle,0);
break;
}
}
}
else //no selection
{
POINT cpos;
GetCursorPos(&cpos);
TrackPopupMenu(object->popupnoselmenu,TPM_LEFTALIGN,cpos.x,cpos.y,0,object->listviewhandle,0);
}
}
break;


This code is not good but i have no idea how to make more shorter.
When the user selects menu item in popup menu,the WM_COMMAND message handler calls virtual function which must be described in derived class.So certain type of universality is achieved :)

In Topic: Get text length

03 May 2010 - 01:46 AM

I tried to use GetTextExtentPoint32 function. It returns wrong string dimensions.

PARTNERS