Hi all,
I am writing a bit-check function just to make it easier on myself to check status flags in my classes. I use char variables and each bit represents something on or off. Since I have...
Type: Posts; User: DarkMasterBosel
Hi all,
I am writing a bit-check function just to make it easier on myself to check status flags in my classes. I use char variables and each bit represents something on or off. Since I have...
The topic pretty much says it here. I have searched for hours for information on how to accomplish this and have turned up empty handed. This is getting EXTREMELY frustrating.
I am using...
I am having a really hard time finding any useful information on this subject, as my main source book is quite wanting. MSDN isn't very helpful in describing how to implement this.
What I want to...
As whiteflags said, you can (and should) set the variable to 0 immediately upon declaration. However, if 0 is a potential value for your variables, an alternative is to set it to some other value...
You can include <conio.h> in your program. You could then do something like this:
cout<<"Press any key to continue"<<endl;
_getch();
Of course you can use whatever message you want in...
The declaration goes like this:
GameSprite* pSpritePointer=new GameSprite[4];
Originally, I had attempted to delete it like this:
if(pSpritePointer)
I have never been in a situation where I wanted to use one until now, so I was a little surprised when I went to delete it and got a "Debug Assertion Error". I can access the array directly through...
I was using reference originally because my laptop, where the program originated, is incompatible with the hardware device.
Until now I had never seen this return code. My DirectX 10 program had been running perfectly fine on a Vista laptop, and the code used a REFERENCE device type for the Direct3D component.
Now,...
A couple of years ago, I wrote my first few C++ programs with Dev-C++. My brother tested them out on his old Compaq, and they worked fine. At some point I upgraded to Visual C++ and ultimately to...
hResult=DirectInput8Create(hInst,DIRECTINPUT_VERSION,IID_IDirectInput8,(void**)&directInputObject,0);
CHECK_HRESULT
...
I just got a simple animation working, only to discover that even without any implanted delays in code, it runs at about 1.1 fps!!! I narrowed the bulk of it down to the Render() function that I use...
I wanted to make sure becuase as long as I have been programming this is the first time I have run into that situation. Considering the whole concept of "data hiding", I was surprised to find that...
class Character
{
public:
TryThis(Character*);
private:
short int Atk;
short int Def;
//other data here, yadda yadda
};
I noticed this when I was doing some programming in my game.
struct coord
{
short int x;
short int y;
coord* cLP;//this is a linked list pointer
Character* cReside;//this points to a...
I am working on an RPG and I use floating point variables for raw character stats. When they are displayed (or used in combat) they are truncated to integers. I use the floating point variables to...
Would it be a "wise" choice to use char variables to store very small integers (such as 0 to 99) for the sake of saving memory (1 byte as opposed to 2 for a short int), and then casting that value to...
Hmm, I will keep that in mind. I was actually going to implement this system into a class anyhow, and include the "enum" in a declarations header file. Overloading the = operator makes sense though.
I want to be able to use the actual integers, rather than an enumerated name.
What I want to do is something similar to an enum. I want to declare a type that can only take on the integer values from 0 to 4, inclusive. I cannot seem to find a way to do this.
Got it working now, thanks a lot!
I have my main.cpp file, and I have a slew of headers with class declarations and their accompanying .cpp files with their code. Take, for instance, Dummy1.h and Dummy1.cpp.
Dummy1.h:
...
#ifndef _LPCWAVEFORMATEX_DEFINED
#define _LPCWAVEFORMATEX_DEFINED
typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
#endif // _LPCWAVEFORMATEX_DEFINED
I am using Visual Studio 2005 to do some...
Unicode......*scratches head* Don't know anything about that yet. *
So far, using
MessageBox(hWnd,TEXT("string 1"),L"string 2",MB_OK);
either method that you guys presented works. The...
Normally, I include windows.h since I am 'trying' to program a windows application. I have been using DirectX the last few days and I just got things working to where I could draw a triangle on the...