Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 Apr 2008
Offline Last Active Today, 01:28 AM

#4877899 Adding icon to my exe in Visual Studio 2008

Posted by on 28 October 2011 - 10:15 AM

Hello, try taking a look at ResEdit .

#4853088 Funky std::ifstream behavior [C++]

Posted by on 23 August 2011 - 11:33 PM

Hello! Maybe your problem is in the way you open your file. You use an ifstream so you don't have to specify ios::in, because it opens it for reading anyway. And instead of || you would have to use the single |.

Try it like this:

std::ifstream file(filepath, ios::binary);

I don't really know if this will help you but you can give it a try.

#4845551 To goto or not to goto?

Posted by on 06 August 2011 - 03:26 PM

I never use goto statements. It's generally unsafe to change the flow of an application in this way. Almost in every situation there are more suitable techniques that are safer, and which won't create spaghetti.

#4841006 Trouble moving sprites

Posted by on 27 July 2011 - 02:44 AM

I'm not 100% sure what that "spriteField" is, but when it is what I think, say a List of all the sprites, then your for loop may be the problem.

Try :

for ( int i = 0; i <= spriteField.size(); i++)

So it iterates correctly through all the Sprites, otherwise it will forget the last one. ( <= instead of <)

Hi! I don't think that is true. From 0 to < spriteField.size() there are n elements. From 0 to <= spriteField.size() the are n+1 elements. This means, there is one more sprite which he has not added in the vector. This should throw an index out of bounds exception.

#4840797 Debug and Release

Posted by on 26 July 2011 - 02:46 PM

Yes, of course. Check for uninitialized variables in your code first (this includes unallocated memory). Another cause could be that the application cannot find resources like images, text files etc... supposing you use them in your application.

#4840721 FPS GAMES SUCK!

Posted by on 26 July 2011 - 12:29 PM

I don't believe that to be true! The games you mentioned don't "suck" at all, even though I'm not that big of a fun of Crysis. I especially liked the F.E.A.R series, Doom 3 and Return to castle Wolfenstein (these are my favorites). And even though I don't like a game, I still find great elements in almost each and every one of them. That being from a developer point of view. Anyway, it's your opinion.

#4840467 Debug and Release

Posted by on 26 July 2011 - 06:20 AM

Hi. What problems do you have exactly ? Usually, most release problems are caused by uninitialized variables and such.

#4838421 Functions and Variables (C++)

Posted by on 21 July 2011 - 06:59 AM

void timestepfoward(){
    cout << "\n\nIt is currently year " << currentyear << " and the population is " << initpop << ".\n";
    cout << "How many years would you like to skip? ";
    cin >> t;
    currentyear = t+currentyear;
    cout << "\nIt is now year " << currentyear << " and the population is now " << newpopulation << ".\n";
    newpopulation=initpop; // shouldn't this line be: initpop = newpopulation; ?  	

#4837911 error LNK2001: unresolved external symbol

Posted by on 20 July 2011 - 05:55 AM


D3DSURFACE_DESC is not a pointer, so you cannot set it to NULL. vertices is an array of structures, so you cannot set that to be NULL either.
You can use memset or ZeroMemory though on them. But you will have to do that in your Initialize()function.

#4837902 error LNK2001: unresolved external symbol

Posted by on 20 July 2011 - 05:46 AM


//You have to specify to which class surface belongs (i.e GraphicsEngine), you forgot to put that in your code. 
D3DSURFACE_DESC   GraphicsEngine :: surface;

// Put this line with the rest of the static members in your cpp file
CUSTOMVERTEX GraphicsEngine :: vertices[4];

This will solve your errors.

#4837856 error LNK2001: unresolved external symbol

Posted by on 20 July 2011 - 03:08 AM

Hello ...

Try this: before the function: void GraphicsEngine::Initialize(HWND hWnd), you need to define those static member variables

#include <d3d9.h>
#include <d3dx9tex.h>
#include "GraphicsEngine.h"
#include "Main.h"

LPDIRECT3D9  GraphicsEngine :: d3d = NULL;
LPDIRECT3DDEVICE9  GraphicsEngine :: d3ddev = NULL;
LPDIRECT3DVERTEXBUFFER9 GraphicsEngine :: v_buffer = NULL;
IDirect3DTexture9*  GraphicsEngine :: texture = NULL;
D3DSURFACE_DESC   GraphicsEngine :: surface;
VOID* GraphicsEngine :: pVoid = NULL;

void GraphicsEngine::Initialize(HWND hWnd)

#4826289 Illegal use of type 'void'

Posted by on 22 June 2011 - 12:44 AM


//basic functions
void handle_input;
void move;
void render;

These are supposed to be functions. However, you don't specify their prototypes completely. You need to add the parameter list. If the functions
don't have parameters, just add empty parentheses.

Like so:

//basic functions
void handle_input();
void move();
void render();