|
I am a learner of OpenGL,and use it to write a full-screen programme with big scene,in which user can walk around.Now I want to add a compass(A box and Needle)at the right-top conner of the screen to indicate the direction(just as game "Dngeon Siege").I known how to draw the appearance of the compass but do not known how to make some setting before drawing the compass.
Can you give me some code or advice?Any help are appreciated!
C/C++ code fans
|
|
|
|
|
I don't know what you really want,but have you check this site?
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Thanks a lot!
I often go to http://nehe.gamedev.net/,unfortunately,I can't find what I want.
My doubt is "how to make the compass at the corner of the screen when user roam around".Or rather,how to draw a circle there when user roam:the circle is still at the corner,keep immobility,It seems that it is not associated with the 3D space!
C/C++ code fans
|
|
|
|
|
zjkw wrote:
how to draw a circle there when user roam:the circle is still at the corner,keep immobility,It seems that it is not associated with the 3D space!
Why not check out the source code for Quake or the Crystal Space engine at SourceForge?
There's also a beginners forum at opengl.org.
|
|
|
|
|
Thank you very much,I have finished my idea!
C/C++ code fans
|
|
|
|
|
Hi.
I know it is possible to automate an office application into a dialog in VB. it's simple, MS included an activeX for it.
But in C++/MFC it's different. I don't know which activeX to import (the one the vb uses) and the only documentation I found was how to automate office applications into SDI and MDI applications, but that's not good enough. I want to be able to create a dialog based application (or a new dialog in an already existing application - in my case) and embedd Word or Excel onto that document.
Any ideas ?
The perfect solution will be to use VB's activeX, but I don't know which is it.
|
|
|
|
|
I'm not really into VB, but I guess that theres got to be a way to find out what activeX control it's using..
You should might try to create a dialog box in VB and open the dialog resource file (or which ever way VB stores that in) with a text editor and you might be luvky to find the GUID
Just a shot in the dark =)
Cheers,
Marc
|
|
|
|
|
I think you have to use Automation.There are a lot of articles in MSDN about it.Serach "VC" + "Excel" in MSDN.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
I want to programatically temporatily disable the Windows key on my keyboard (the one that triggers the start menu)..
I tried to create a hook procedure that catches the proper WM_KEYDOWN messages (both WH_KEYBOARD and WH_GETMESSAGE can do this) but I dont know how to discard those messages once I intercept them.
Is there a way to do this or should I use a completely different approach to disable that key?
Thanks,
Marc.
|
|
|
|
|
I think you need to look up CBT hooks and how to use them
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Hi, my drawing application wants to display the color in-use in the status bar, how can I do that?
|
|
|
|
|
GetStatusBarCtrl().SetBkColor( COLORREF cr );
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
It changes the whole status bar to the color specified. How to change a specific pane of the status bar? Thanks.
|
|
|
|
|
I'm sure the status bar class I used to do this years ago came from CP so have a look on the site. You need to create a class that overloads the status bar to do this.....
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Hey!!
Can someone give me a good site that tackles tutorials
about the C-Language preprocessors....
e.g. IFDEF, UNDEF, IFNDEF, etc...
|
|
|
|
|
Rule #1: the preprocessor sucks - avoid using it
Rule #2: See Rule #1.
The preprocessor is evil, avoid it if you can.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
The MS generated code seems to use it a good bit
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nish [BusterBoy] wrote:
The MS generated code seems to use it a good bit
Stroustrup says use of macros usually indicates a bad programmer or a bad design. I guess this proves him right.....
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Christian Graus wrote:
Stroustrup says use of macros usually indicates a bad programmer or a bad design. I guess this proves him right.....
ROTFLMAO
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Christian Graus wrote:
Stroustrup says use of macros usually indicates a bad programmer or a bad design. I guess this proves him right.....
Yes I've read his book. But for my case, I code a set of single code for two kinds of different machines, I have to do with it:
in declaration:
#if MACHINE == TYPE_A
CMyStack m_ctrlStk[10];
#elif MACHINE == TYPE_B
CMyStack m_ctrlStk[3];
#endif
in .cpp:
#if MACHINE == TYPE_A
for(i = 0; i < 10; i++)
#elif MACHINE == TYPE_B
for(i = 0; i < 3; i++)
#endif
{
m_ctrlStk[i].Morph();
}
Maxwell Chen
Lets make bugs better!
|
|
|
|
|
See, I would just use a vector.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Just like the #ifdef _AFXDLL trick in VC++,
#ifdef _AFXDLL
InitXXX();
#else
InitXXXStatic();
#endif
In my case, even the I/O of the machines are different. Thus:
enum _IoAddress {
#if MACHINE == 1
enACSwitch = 0x001,
enRelayMaster = 0x018 // and many many other I/O addresses..
#elif MACHINE == 2
enACSwitch = 0x093,
enRelayMaster = 0x071
#endif
};
Then I can code once, benefitted everywhere:
PLC_SetOutput(enACSwitch, bPowerOn);
PLC_SetFlag(enRelayMaster, bPause);
// ......
Maxwell Chen
Lets make bugs better!
|
|
|
|
|
Stroustrup says a lot of things that I don't agree with. This being one of them.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I avoid using it as much as possible, but do you think that it is ever useful and that it has its uses?
For example, the SAFE_RELEASE macro for COM interfaces:
#define SAFE_RELEASE(ptr) if(ptr) {(ptr)->Release(); ptr = NULL;}
Have you ever found any uses for macros, for some reason or another, C++ code would just not be a good solution?
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
kilowatt wrote:
For example, the SAFE_RELEASE macro for COM interfaces:
Any macro that takes a variable is suspect, and a debugging nightmare.
kilowatt wrote:
Have you ever found any uses for macros, for some reason or another, C++ code would just not be a good solution?
At work I've written some common code as macros after much argument for an inline function. Personally I've used them in one project, a debugging tool where a macro was the only option, because it is able to report the file name and line number in which the trace command was written. A function obviously would not expand in place and therefore not work as I would desire.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|