202 Posted Topics
Ok, I'm writing a simple program with VC++ and DirectX. It's basically a working framework for 3D games, but all I need it to do right now is load a mesh and display it, and it is killing me. I've done this successfully before, I don't know why its not … | |
Hey, So, three questions: 1. What is a DLL and what is a .lib file? 2. (might have been answered w/ #1) What is the purpose of .lib/.dll files? 3. How do I create a .lib file with C++, and (again, may have been answered above) what exactly will this … | |
Re: Yes, in time you will understand the magic of OOP (object oriented programming). Also, as to the struct/class thing: While that is the technical difference between them, the reason they both exist is because structs are left-over functionality from C, and classes are the object-oriented, C++ alternative. Initially, structs (if … | |
Re: Cliffy B is not a programmer. Cliffy B is a project manager (or something along those lines). He would have more to do with ensuring that the entire project is going as planned. As for what OS professional game programmers use, I am not sure exactly, though if by PC … | |
EDIT: Ahhh.. nvm, I found it: [ICODE]die("Error with database".);[/ICODE] should be [ICODE]die("Error with database.");[/ICODE] Might anyone know why the following php script produces [I]no[/I] results? I.e., when I ctrl+u in Firefox, a blank screen comes up. [CODE=php]<html> <head> <title>Create Base</title> </head> <body> <h1>Create Base</h1> <form action="bases.php" method="post"> <table> <tr><td>Name:</td><td><input type="text" … | |
Re: There are a whole bunch of posts like this below somewhere, but basically - try to learn C++ if you don't already. You're going to have to spend some time on just console applications, and that might get boring if you've got games in mind, but have patience. Then, once … | |
Hey, im trying to use the mail() function, but its not working. This is the script: [CODE=php] <html> <head> </head> <body> <?php if(mail("coolgamer48@gmail.com","Test","Test","From:coolgamer48@gmail.com")) { echo "Success"; } else { echo "Failure"; } ?> </body> </html> [/CODE] I keep getting "Failure". Is there an issue with my syntax, or is it … | |
Re: [QUOTE]people disagree and say Java or even VB is the way to go.[/QUOTE] Isn't Java pretty much EXACTLY like C++, except without pointers (and some other, less significant differences). That is, from a programmer's perspective. I suppose the JVM and bytecode are also differences. If so, why wouldn't you want … | |
Hey, I'm doing a school project on how math and physics are used in video games, and I'm trying to find things that I could talk about. The main idea I have right now is how trig is used to calculate the changes in x and y values of an … | |
Hey, I'm having a problem with my RPG. I'm trying to get a player to move from one room to another. All the coordinates (and other properties) of all the objects inside a given room are contained inside a text file, and this includes the properties of an exit to … | |
Hey, when I run this code: [CODE=Cplusplus]else if(strcmp(buffer,"#itemSprite") == 0) { char* sprite_filename = ""; int trans_r; int trans_g; int trans_b; int width; int height; int numFrames; int numCols; int frameChangeDelay; fscanf(file,"%s",sprite_filename); fscanf(file,"%d",&trans_r); fscanf(file,"%d",&trans_g); fscanf(file,"%d",&trans_b); fscanf(file,"%d",&width); fscanf(file,"%d",&height); fscanf(file,"%d",&numFrames); fscanf(file,"%d",&numCols); fscanf(file,"%d",&frameChangeDelay); item->SetSprite(sprite_filename,D3DCOLOR_XRGB (trans_r,trans_g,trans_b),width,height,numFrames,numCols,frameChangeDelay); }[/CODE] I get an error on this line: … | |
hey, is this code: [CODE=C++]if(m_velocity.x == 0) return 0; return ToDegrees(atan(m_velocity.y/m_velocity.x));[/CODE] any more efficient than this code: [CODE] if(m_velocity.x == 0) return 0; else return ToDegrees(atan(m_velocity.y/m_velocity.x));[/CODE] I.e., are we saving any time by omitting the else statement? | |
Hey, so I'm making a Breakout game in C++ w/ DirectX, and I'm having some trouble thinking of the ball bouncing physics. The way I've made breakout games before was to have the ball only move at 45 degree angles. This was fairly simple. Just reverse the x or y … | |
Hey, so I have a file I use to store my own math functions called MyMath.h. I included MyMath.h in my main.cpp file and it worked fine. But then I tried including it to another file, and I get this error: Block.obj : error LNK2005: "int __cdecl Random(int,int,bool)" (?Random@@YAHHH_N@Z) already … | |
Re: [QUOTE=pcbrainbuster;605594]If you want to make good money then I recommend getting yourself a PC and then to learn C++ --> Win32/MFC(or both) --> DirectX/OpenGL(or both which would be better).[/QUOTE] Note that DirectX and OpenGL are not game engines (neither are Win32 or MFC). They are APIs. Game aren't really too … | |
Re: [QUOTE=jwenting;577848]and don't buy any book calling itself "for dummies". [/QUOTE] I don't know about that.... The first real language I learned was C++ and it was from a "for dummies" book. | |
Hey, am I correct in assuming that when you declare a function virtual in a prototype, it is illegal to use the virtual keyword again when you define the function? | |
Re: If [I]Microsoft[/I] Visual C++ 2008 doesn't work on [I]Microsoft[/I] Vista, that's pretty sad for Microsoft. | |
Re: You might want to repost your program (using code tags) to see if it really was fixed. Also, you may want to change something like [CODE]first = number/1000; [/CODE] to [CODE]first = floor(number/1000);[/CODE] floor() is declared in math.h (so add #include<cmath> or #include<math.h> to the top of your source). i … | |
Re: First off, [ICODE]for(;conditional;)[/ICODE] is the same as [ICODE]while(conditional)[/ICODE]. So you can fix that. Also, initial_loan_amount is being declared but not initialized (i.e., its filled with nonsense). Fix that. | |
Hey, So, I'm trying to learn DirectSound, and imagine my delight to learn that DirectSound doesn't have any interface for loading wave files! So MSDN refers me to the DXUT.h file that can be used to load .wav files and even to take care of some DirectSound stuff for you. … | |
Re: Or, if you'd like to keep in consistent with the code for player 1's attack, you could simply put it outside of the switch statement but inside the while loop (like line 57 or 58 in Sky Diploma's program). If you do do that though, remember to take away that … | |
Re: If you'd like to being learning C++ (I'm guessing you do seeing this is the C++ forum). [URL="http://cplusplus.com"]cplusplus.com[/URL] is a good online resource. If you're looking for a book I learned C++ from [i]C++ for Dummies[/i], and I'd recommend that or other books by Stephen Randy Davis. Dev-C++ is a … | |
Re: I skimmed the article, but is the only problem with rand() that RAND_MAX may not be one less than a multiple of your maximum? Like if you do rand()%3, and RAND_MAX+1 is a multiple of 3, will that be truly random? | |
Re: Im not exactly sure if this would work, but couldn't you just use srand() to ensure that results of same names come out the same. Like use the length of both strings combined instead of time(NULL). not sure if this will work though. | |
Re: DirectX and OpenGL are not programming languages. They are APIs (application programming interfaces, wiki it if you want) that can be used with other programming languages (like C++). As far as which one is better, don't know if I can help you too much there. The only real programming language … | |
Re: [QUOTE=bugmenot;592596]start with this [code]bool discr(double array2[3], double &result)[/code] do you know how to use c++ references?[/QUOTE] Are references less or more efficient than using pointers? Also, if I were to call this function, would the second parameter be simple of type double? or would it be double*? | |
I keep getting D3DERR_INVALIDCALL from my CreateDevice() call. Here it is: [CODE]long dev_result = d3d->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,m_window,D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp,&m_device);[/CODE] I think the problem is with m_window. Here's its creation: [CODE]if((m_window = CreateWindow("WindowClass",m_setup->name,g_deviceEnumeration->IsWindowed() ? WS_OVERLAPPED : WS_POPUP,0,0,800,600,NULL,NULL,m_setup->instance,NULL)) == NULL) { MessageBox(NULL,"Error creating the window","CreateWindow()",MB_OK | MB_ICONERROR); return; }[/CODE] It's really weird. I put breakpoints … | |
Re: Um, do you mean something like: [CODE]if(minutes > 59) { //whatever error you want to come up, ex: cout << "Error: minutes entered was over 59"; }[/CODE] where minutes is already defined as the number of minutes you got from the user. | |
Re: [QUOTE=KK Murage;590820]I had already started it and used friend function to calculate the total toll fee,static member function to calculate the total no. of vehicles that passed the tollstation but my codes ain't right.[/QUOTE] What isn't right exactly? Show us a sample of what you have and why/where it's not … | |
Re: If you didn't get it from the above post: on line 14, you declare amount as a double, but don't initialize it to anything. then, in the getHoursRate() function, you declare a SECOND double called amount, which will go out of scope as soon as the function ends. you're saving … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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? | |
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, … | |
Re: For my experience (which I'll admit is relatively limited), books are often a better learning tool than online tutorials for complex programming languages like C++. If you've got the cash, I'd buy a book. I learned C++ from [I]C++ for Dummies[/I] by Stephen Randy Davis. I really love Davis's writing. … | |
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 … | |
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 … | |
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 … | |
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: { … | |
nvm - this topic can be closed sorry for wasting space | |
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, … | |
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, … | |
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 … | |
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 … | |
Quick question: what is OpenGL? Is it an equivalent to DirectX? | |
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 … | |
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 … |
The End.