70 Discussion / Question Topics

Remove Filter
Member Avatar for CoolGamer48

Hey, I keep getting this error: error LNK2019: unresolved external symbol "public: struct IDirect3DDevice9 * __thiscall Engine::GetDevice(void)" when I try to compile my project. MSDN says that IDirect3DDevice9 uses d3d9.lib, but it still won't work even with that lib in additional dependencies. (using VC++ 2008) I tried linking to a …

Member Avatar for CoolGamer48
0
126
Member Avatar for CoolGamer48

Hey, I'm having problems with my OS. At random times - right after I press Ctrl + 'S', the system just restarts (which is annoying because whatever I just tried to save is lost). It's happened around 4 or 5 times so far, but they've all been spread apart. But …

Member Avatar for bobbyraw
0
98
Member Avatar for CoolGamer48

Hey - so I'm writing this game engine with help from a book. I'm encountering some difficulties with DirectInput. I keep having problems when I try to poll the keyboard. When I first try to poll the keyboard - i get DIERR_NOTACQUIRED - which I found out means that the …

0
74
Member Avatar for CoolGamer48

[CODE] ResourceManager(void (*CreateResourceFunction) (Type** resource, char* name, char* path) = NULL) { m_list = new LinkedList<Type>; CreateResource = CreateResourceFunction; }[/CODE] hey - this is code for a contructer for a class (taking the code from a book I bought). What exactly is the parameter of the function? Is the parameter …

Member Avatar for Salem
0
93
Member Avatar for CoolGamer48

Is there a difference between a class and a struct? At first I thought a struct could not have methods/constructors/destructors, but now I found out they can, so what is the difference?

Member Avatar for sarehu
0
76
Member Avatar for CoolGamer48

Hey - sorry if this is the wrong place for this. I have this basic chess game I'm making, and I'm done with the first alpha build of it. It works fine when I compile it on my own computer, but when I bring the exe to a different computer, …

Member Avatar for CoolGamer48
0
188
Member Avatar for CoolGamer48

Does anyone know how to make a surface tile when using DirectX? I tried to write the code for it myself, and I couldn't get it right. I had the right basic idea (I think), but I couldn't quite figure out how to organize the finer details. I'm wondering if …

0
59
Member Avatar for CoolGamer48

Is there any reason why the code below won't work (I mean as far as writing output to file, not as far as writing the correct output to the file): [CODE] #include <cstdio> #include <iostream> #include <fstream> using namespace std; int main() { ofstream fout ("ride.out"); ifstream fin ("ride.in"); char …

Member Avatar for Ancient Dragon
0
289
Member Avatar for CoolGamer48

Hey, So, my understanding of header files so far are that they're basically code that can be used by multiple .cpp files. But if you have a prototype in a file.h that's declared in a file.cpp that includes file.h, and then FILE.cpp includes file.h, does FILE.cpp have access to the …

Member Avatar for Ancient Dragon
0
179
Member Avatar for CoolGamer48

I'm trying to make my game pause if the user presses the 'P' button, and then unpause again with the P button. The pausing works when it's only pausing: [CODE]game_state = PAUSED;[/CODE] I've currently tried the following with pausing and unpausing - none have worked: [CODE]switch(game_state) { case RUNNING: { …

Member Avatar for prushik
0
363
Member Avatar for CoolGamer48
Member Avatar for CoolGamer48

Don't know if anyone here will be able to help me - but here I go. I'm reading [i]Beginning Game Design[/i] by Jonathon S. Harbour. In a chapter on DirectSound, the author says to go the DirectX SDK, and then go to \samples\c++\common to get four files (dsutil.h, dxutil.h, dsutil.cpp, …

Member Avatar for CoolGamer48
0
121
Member Avatar for CoolGamer48

Hey, Is there anyway to control a volatile number of objects (don't know if I'm using the right term here... I mean when you don't know how many of an object you're going to have at any one time), like bullets in a shooter. If you have a bullet class, …

Member Avatar for VernonDozier
0
129
Member Avatar for CoolGamer48

Does anyone have some good logic (not necessarily code, but if you happen to have to urge to give C++ code snippets, be my guest) for collision checking? I know about the IntersectRect function from DirectX, but using that isn't enough. I was planning on moving the player back to …

Member Avatar for Phaelax
0
112
Member Avatar for CoolGamer48

Hey, I'm trying to use trig to create a rotating tank (you rotate the tank by pressing left and right, and move forward and back by using up and down). I'm using this formula (C++): [CODE] tank.movex = cos(tank.direction*0.0174532925)*tank.move; tank.movey = sin(tank.direction*0.0174532925)*tank.move; tank.x += tank.movex; tank.y += tank.movey;[/CODE] tank.move is …

Member Avatar for CoolGamer48
0
105
Member Avatar for CoolGamer48
Member Avatar for John A
0
132
Member Avatar for CoolGamer48

Hey, sorry if I'm in the wrong forum, but I need some help with getting the left and top values for a tile from a tile set. A book I have gives these two formulae: [CODE]left = (current frame % number of columns) * sprite width top = (current frame …

Member Avatar for CoolGamer48
0
60
Member Avatar for CoolGamer48

Hey, I'm trying to learn DirectX from this book ([I]Beginning Game Design[/I] by John S. Harbour, if anyone knows the book). I keep getting a LNK2019 error because [ICODE]Direct3DCreate9(D3D_SDK_VERSION)[/ICODE] is an "unresolved external symbol". Based on my slightly limited knowledge on libraries and include files and a little of my …

Member Avatar for CoolGamer48
0
169
Member Avatar for CoolGamer48

Hey, just wondering - I've seen numbers like 1.0f in examples and in books, but what does the 'f' mean? Does it just mean that the number is a floating point number? And does including/excluding it change anything?

Member Avatar for ShawnCplus
0
142
Member Avatar for CoolGamer48
Member Avatar for Ancient Dragon
0
141