|
First,thank you for yours helpfull answer,
I would like to ask you how can I have an access to the name of each procces, i.e I need to chack whether certain program is active.
thanks again
|
|
|
|
|
Please see the usage of the field ProcessEntry32.szExeFile in the second function above
virtual void BeHappy() = 0;
|
|
|
|
|
Just a thought, but have you looked at Process32First() and related functions?
|
|
|
|
|
How many processes does Task Manager report? How does that compare to cProcesses ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hello Everybody !
when I call the system font dialog like this,how to set the default font name and size ?
HFONT FAR PASCAL MyCreateFont( void )
{
CHOOSEFONT cf;
LOGFONT lf;
HFONT hfont;
cf.lStructSize = sizeof(CHOOSEFONT);
cf.hwndOwner = (HWND)NULL;
cf.hDC = (HDC)NULL;
cf.lpLogFont = &lf;
cf.iPointSize = 0;
cf.Flags = CF_SCREENFONTS;
cf.rgbColors = RGB(0,0,0);
cf.lCustData = 0L;
cf.lpfnHook = (LPCFHOOKPROC)NULL;
cf.lpTemplateName = (LPSTR)NULL;
cf.hInstance = (HINSTANCE) NULL;
cf.lpszStyle = (LPSTR)NULL;
cf.nFontType = SCREEN_FONTTYPE;
cf.nSizeMin = 0;
cf.nSizeMax = 0;
ChooseFont(&cf);
hfont = CreateFontIndirect(cf.lpLogFont);
return (hfont);
}
Thanks for your reply !
Best Regards !
|
|
|
|
|
It took me 10 seconds to google one word and find the answer, in the form of this sentence:
If you set the ... flag in the Flags member and initialize the other members, the ChooseFont function initializes the dialog box with a font that matches ...
|
|
|
|
|
I'm sorry...
thanks !
|
|
|
|
|
No problem.
|
|
|
|
|
Hi guys, i try to write my data into a binary file, but j have some problem in it . I dont know what happening inside..
class Person{
char Name[50];
char Address[10;
bool sex;
short age;
public:
Person();
Person(char* name, char *address, bool sex, short age);
const char* GetName() const;
const char* GetAddress() const;
};
ostream& operator<<(ostream& out, const Person&p)
{
out.write(reinterpret_cast<const char*>(&ap), sizeof(p));
return out;
}
istream& operator>>(istream& in, Person &p)
{
in.read(reinterpret_cast<char*>(&p), sizeof(p));
return in;
}
class Account_Property{
int account_number;
double amount;
bool account_type;
Person p;
public:
Account_Property();
Account_Property(Person p, int ac_num, bool ac_type, double amt);
int GetAccountNumber()const;
double GetAmount()const;
};
ostream &operator<<(ostream &out, const Account_Property &ap)
{
out.write(reinterpret_cast<const char*>(&ap), sizeof(ap));
return out;
}
istream& operator>>(istream &in, Account_Property &ap)
{
in.read(reinterpret_cast<char*>(&ap), sizeof(ap));
return in;
}
Thanks in Advance
|
|
|
|
|
Your problem is with
sizeof const Person& which should give the size of the reference and not the object.
Change
sizeof(p) to
sizeof(Person) etc.
|
|
|
|
|
Can you edit your article text to show symbols rather than XML entities?
I think Niklas is correct but it's rather hard to read!
|
|
|
|
|
I wrote a program that renders up to 200 characters that move across the screen at an 8 o'clock heading, isometric game style. I randomize each character's x and y coordinates and speed prior to rendering, which are rendered onto transparent quads. Since every object's z coordinate value is the same, the object rendered last is considered to have the least depth (e.g. it is rendered on top of everything else).
Now for my question: How should I go about ordering each object so that the ones with a greater y value are rendered after objects with a lesser y value? My rendering code currently runs through an array of the characters from 0-199 and resets, which causes some visually obvious depth problems.
To illustrate:
<br />
character[0].y = 1000;<br />
character[1].y = 1200;<br />
character[2].y = 200;<br />
They should be rendered in this order: character 2 -> character 0 -> character 1. I'm not sure how I can order them this way though.
Thanks for any help and ideas
Edit: Added example
modified on Saturday, September 4, 2010 2:15 AM
|
|
|
|
|
why not just use the GL depth buffer?
|
|
|
|
|
I thought you could only do that if objects had differing z coordinates. How do you use the depth buffer without it?
|
|
|
|
|
that's right, depth buffering is based on the z coordinate of each pixel (after the transforms are applied and things are in screen-space). I mentioned it thinking perhaps you could use that to your advantage and assign depths to the various characters and then let depth buffering handle overlapping cases.
|
|
|
|
|
I would like to do it this way but I'm not sure how I can while maintaining the isometric perspective I have set up. Currently every object in my program has a z value of -6.0f. If I change it the characters will appear to the program user as if some are bigger than others, which is not something I want to happen. Should I scale the size of my quads to compensate for the different depth values? Or am I making things more difficult than they really are?
Thank you for the replies
|
|
|
|
|
I'm not sure -- I'm finding it hard to visualize what you're doing. A couple notes though.
You could use an orthographic projection instead of perspective so that near and distant objects appear the same size.
On the other hand, if sorting them is the only way that will work, then the question is, how often are the chars generated? If only periodically, perhaps you could, after generating them, sort them by the y value. Then you'd have a sorted list you could walk through to render.
|
|
|
|
|
Using glOrtho instead of gluProjection worked for me. In order to make transparency work in conjunction with depth testing I used glAlphaFunc(GL_GREATER, 0.1); Luckily my textures only have a single color that needed to be transparent (white background). I appreciate your help in getting this working
|
|
|
|
|
awesome! glad to hear its working
|
|
|
|
|
I made something similar some years ago. There is indeed two options: either go with the depth buffer as suggested by the other poster, but you'll need to find an algorithm to modify it depending on the y position of the node. The easiest would be that when you modify the y value of your character, you assign the same value to the z value.
Another option as already mentioned is sorting your nodes before rendering. This could be done quite easily by storing all your nodes in a list, and before you draw all the nodes you first sort the list based on the y value of the nodes.
|
|
|
|
|
DeviceIoControl with IOCTL_DISK_GET_DRIVE_LAYOUT does not give correct values on windows7. While it works fine on windows xp.
|
|
|
|
|
Ok, and?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
DeviceIoControl can be used with IOCTL_DISK_GET_DRIVE_LAYOUT parameter to get drives details. When i use this on windows xp it gives correct values for drive start address, drive size, hidden sectors etc. But when i run same code on windows7 the values are not correct.
How to get the correct information on windows 7. It gives me wrong information like drive start address, size etc
|
|
|
|
|
MKC002 wrote: It gives me wrong information like drive start address, size etc
Are the values just outright garbage, or maybe just some other power of 2 (e.g., 512 instead of 1024)?
What does DeviceIoControl() return?
What are you using to compare these "wrong" values against?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|