Jump to content
  • Advertisement
Sign in to follow this  
Motoky12

Stupid amount of Error Messages...

This topic is 2488 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I am currently working through Beginning DirectX 9 by Wendy Jones. I am on Chapter 5 and I am currently practising writing up the code without looking at the code itself, but following my own step by step guide on how to write the code without giving too much away. It seems to be helping quite a lot and I have written this code which draws a cube to the screen, translates it and then rotates around the Y axis. It's already in the examples that came with the book, but I feel it is good practice to write up the code without looking at it at all.

Anyway, I've been having trouble actually executing this code. I started to get these errors:

1>------ Build started: Project: Cubes, Configuration: Debug Win32 ------
1> winmain.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\..\..\..\Part II - It's A 3D World After All\Chapter 5 - Matrices, Transforms, and Rotations\Notes\Cubes\winmain.cpp': No such file or directory
1> dxManager.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\..\..\..\Part II - It's A 3D World After All\Chapter 5 - Matrices, Transforms, and Rotations\Notes\Cubes\dxManager.cpp': No such file or directory
1> Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I couldn't find much on the internet, so I thought maybe I had to put the code in another place because the file directory was getting too long. So I created another project, and decided to copy and paste my code to this new project. Changing the properties such as Character Set and including the appropriate library files. I try and compile it and I get these errors:

1>------ Build started: Project: Cube, Configuration: Debug Win32 ------
1> winmain.cpp
1>c:\users\jamie\desktop\cube\dxmanager.h(26): error C2146: syntax error : missing ';' before identifier 'pD3D'
1>c:\users\jamie\desktop\cube\dxmanager.h(26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\jamie\desktop\cube\dxmanager.h(26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\jamie\desktop\cube\dxmanager.h(27): error C2146: syntax error : missing ';' before identifier 'pD3DDevice'
1>c:\users\jamie\desktop\cube\dxmanager.h(27): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\jamie\desktop\cube\dxmanager.h(27): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1> dxManager.cpp
1>c:\users\jamie\desktop\cube\dxmanager.h(26): error C2146: syntax error : missing ';' before identifier 'pD3D'
1>c:\users\jamie\desktop\cube\dxmanager.h(26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\jamie\desktop\cube\dxmanager.h(26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\jamie\desktop\cube\dxmanager.h(27): error C2146: syntax error : missing ';' before identifier 'pD3DDevice'
1>c:\users\jamie\desktop\cube\dxmanager.h(27): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\jamie\desktop\cube\dxmanager.h(27): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\jamie\desktop\cube\dxmanager.cpp(7): error C2065: 'pD3D' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(8): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(18): error C2065: 'pD3D' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(20): error C2065: 'pD3D' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(20): error C2227: left of '->Release' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\users\jamie\desktop\cube\dxmanager.cpp(21): error C2065: 'pD3D' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(24): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(26): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(26): error C2227: left of '->Release' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\users\jamie\desktop\cube\dxmanager.cpp(27): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(42): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(45): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(45): error C2227: left of '->Clear' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\users\jamie\desktop\cube\dxmanager.cpp(51): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(51): error C2227: left of '->Present' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\users\jamie\desktop\cube\dxmanager.cpp(56): error C2065: 'pD3D' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(73): error C2065: 'pD3D' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(73): error C2227: left of '->CreateDevice' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\users\jamie\desktop\cube\dxmanager.cpp(75): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(124): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(124): error C2227: left of '->CreateVertexBuffer' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\users\jamie\desktop\cube\dxmanager.cpp(154): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(154): error C2227: left of '->SetTransform' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\users\jamie\desktop\cube\dxmanager.cpp(170): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(170): error C2227: left of '->SetTransform' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\users\jamie\desktop\cube\dxmanager.cpp(177): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(177): error C2227: left of '->BeginScene' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\users\jamie\desktop\cube\dxmanager.cpp(179): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(179): error C2227: left of '->SetStreamSource' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\users\jamie\desktop\cube\dxmanager.cpp(181): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(181): error C2227: left of '->SetFVF' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\users\jamie\desktop\cube\dxmanager.cpp(189): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(189): error C2227: left of '->SetTransform' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\users\jamie\desktop\cube\dxmanager.cpp(191): warning C4552: '+' : operator has no effect; expected operator with side-effect
1>c:\users\jamie\desktop\cube\dxmanager.cpp(192): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(192): error C2227: left of '->DrawPrimitive' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\users\jamie\desktop\cube\dxmanager.cpp(194): error C2065: 'pD3DDevice' : undeclared identifier
1>c:\users\jamie\desktop\cube\dxmanager.cpp(194): error C2227: left of '->EndScene' must point to class/struct/union/generic type
1> type is ''unknown-type''
1> Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


It's quite a long list of errors and they are all pretty much the same. This is pretty much the same code I have been using throughout the few chapters of the book and haven't been getting any of these errors at all.

This is my code, remember pretty much the same code from other chapters:

customVertex.h File
struct CUSTOMVERTEX
{
float x, y, z;
DWORD color;
};


dxManager.h File
#ifndef DXMANAGER_H
#define DXMANAGER_H
#include <d3d9.h>
#include <d3dx9.h>
#include "customVertex.h"
class dxManager
{
public:
dxManager();
~dxManager();
void cleanUp(void);
void clearScreen(void);
void endScene(void);

bool initDirect3D(HWND hWnd);
bool createCube(void);
void createCamera(float nearClip, float farClip);
void moveCamera(D3DXVECTOR3 vec);
void lookCamera(D3DXVECTOR3 vec);
void renderScene(void);
private:
LPDIRECT3D pD3D;
LPDIRECT3DDEVICE pD3DDevice;
LPDIRECT3DVERTEXBUFFER9 pVertexBuffer;
IDirect3DSurface9* pBackBuffer;
HRESULT hResult;
D3DXMATRIX viewMat;
D3DXMATRIX projMat;
D3DXVECTOR3 cameraPosition;
D3DXVECTOR3 cameraLook;
};
#endif // DXMANAGER_H


dxManager.cpp File
#include "dxManager.h"
#define CUSTOMFVF (D3DFVF_XYZ | D3DFVF_DIFFUSE)
dxManager::dxManager()
{
pD3D = NULL;
pD3DDevice = NULL;
pVertexBuffer = NULL;
}
dxManager::~dxManager()
{
}
void dxManager::cleanUp(void)
{
if(pD3D != NULL)
{
pD3D->Release();
pD3D = NULL;
}
if(pD3DDevice != NULL)
{
pD3DDevice->Release();
pD3DDevice = NULL;
}
if(pVertexBuffer != NULL)
{
pVertexBuffer->Release();
pVertexBuffer = NULL;
}
}
void dxManager::clearScreen(void)
{
pBackBuffer = NULL;
hResult = NULL;
if(pD3DDevice == NULL)
return;
pD3DDevice->Clear(0, 0, D3DCLEAR_TARGET,
D3DCOLOR_XRGB(0,0,0), 1.0f, 0.0);
}
void dxManager::endScene(void)
{
pD3DDevice->Present(NULL, NULL, NULL, NULL);
}
bool dxManager::initDirect3D(HWND hWnd)
{
if(NULL == (pD3D = Direct3DCreate9(D3D_SDK_VERSION)))
{
hResult = E_FAIL;
return false;
}
D3DPRESENT_PARAMETERS pD3DPresent;
ZeroMemory(&pD3DPresent, sizeof(D3DPRESENT_PARAMETERS));
pD3DPresent.BackBufferWidth = 640;
pD3DPresent.BackBufferHeight = 480;
pD3DPresent.BackBufferFormat = D3DFMT_X8R8G8B8;
pD3DPresent.BackBufferCount = 0;
pD3DPresent.SwapEffect = D3DSWAPEFFECT_DISCARD;
pD3DPresent.hDeviceWindow = hWnd;
pD3DPresent.Windowed = true;
hResult = pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&pD3DPresent, &pD3DDevice);
if(FAILED(hResult))
return false;
return true;
}
bool dxManager::createCube(void)
{
CUSTOMVERTEX gVertices[] =
{
// 1
{-64.0f, 64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{ 64.0f, 64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{-64.0f, -64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{ 64.0f, -64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)},
// 2
{-64.0f, 64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{-64.0f, -64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{ 64.0f, 64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{ 64.0f, -64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)},
// 3
{-64.0f, 64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{ 64.0f, 64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{-64.0f, 64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{-64.0f, 64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)},
// 4
{-64.0f, -64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{-64.0f, -64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{ 64.0f, -64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{ 64.0f, -64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)},
// 5
{ 64.0f, 64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{ 64.0f, 64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{ 64.0f, -64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{ 64.0f, -64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)},
// 6
{-64.0f, 64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{-64.0f, -64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{-64.0f, 64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)},
{-64.0f, -64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)}
};
hResult = pD3DDevice->CreateVertexBuffer(sizeof(gVertices) *
sizeof(CUSTOMVERTEX),
D3DUSAGE_SOFTWAREPROCESSING,
CUSTOMFVF,
D3DPOOL_DEFAULT,
&pVertexBuffer,
NULL);
if(FAILED(hResult))
return false;
VOID* vertexData;
hResult = pVertexBuffer->Lock(0, 0, (void**)vertexData, D3DLOCK_DISCARD);
if(FAILED(hResult))
return false;
memcpy(vertexData, gVertices, sizeof(gVertices));
pVertexBuffer->Unlock();
return true;
}
void dxManager::createCamera(float nearClip, float farClip)
{
D3DXMatrixPerspectiveFovLH(&projMat, D3DX_PI/4, 640/480,
nearClip, farClip);
pD3DDevice->SetTransform(D3DTS_PROJECTION, &projMat);
}
void dxManager::moveCamera(D3DXVECTOR3 vec)
{
cameraPosition = vec;
}
void dxManager::lookCamera(D3DXVECTOR3 vec)
{
cameraLook = vec;
D3DXMatrixLookAtLH(&viewMat, &cameraPosition,
&cameraLook,
&D3DXVECTOR3(0.0f, 1.0f, 0.0f));
pD3DDevice->SetTransform(D3DTS_VIEW, &viewMat);
}
void dxManager::renderScene(void)
{
D3DXMATRIX objectMat, translationMat, rotationMat;
pD3DDevice->BeginScene();
pD3DDevice->SetStreamSource(0, pVertexBuffer, 0, sizeof(CUSTOMVERTEX));
pD3DDevice->SetFVF(CUSTOMFVF);
D3DXMatrixTranslation(&translationMat, 0.0f, 64.0f, 0.0f);
D3DXMatrixRotationY(&rotationMat, timeGetTime()/1000.0f);
D3DXMatrixMultiply(&objectMat, &translationMat, &rotationMat);
pD3DDevice->SetTransform(D3DTS_WORLD, &objectMat);
for (int i = 0; i < 20; i+4)
pD3DDevice->DrawPrimitive(D3DPT_TRIANGLELIST, i, 2);
pD3DDevice->EndScene();
}


winmain.cpp File
#include "dxManager.h"
HINSTANCE hInstance;
HWND hWnd;
dxManager* dxMgr = new dxManager();
bool initWindow(HINSTANCE hInstance);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
void initCamera();
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR cmdLine, int cmdShow)
{
if(!initWindow(hInstance))
return false;
if(!dxMgr->initDirect3D(hWnd))
return false;
if(!dxMgr->createCube())
return false;
initCamera();
MSG msg;
ZeroMemory(&msg, sizeof(MSG));
while(msg.message != WM_QUIT)
{
if(PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
{
dxMgr->clearScreen();
dxMgr->renderScene();
dxMgr->endScene();
}
}
dxMgr->cleanUp();
return (int)msg.wParam;
}
bool initWindow(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = NULL;
wcex.cbWndExtra = NULL;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = NULL;
wcex.lpszClassName = "DirectXExample";
wcex.hIconSm = NULL;
RegisterClassEx(&wcex);
hWnd = CreateWindow("DirectXExample", "DirectXExample",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
640, 480, NULL, NULL, hInstance, NULL);
if(!hWnd)
return false;
ShowWindow(hWnd, SW_SHOW);
UpdateWindow(hWnd);
return true;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_DESTROY:
PostQuitMessage(0);
break;
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
void initCamera()
{
dxMgr->createCamera(1.0f, 500.0f);
dxMgr->moveCamera(D3DXVECTOR3(0.0f, 0.0f, -450.0f));
dxMgr->lookCamera(D3DXVECTOR3(0.0f, 0.0f, 0.0f));
}


I know it's quite a lot to look through, but it's best to just include it all rather than none. Some of these errors are appearing on my dxManager.h file where I have declared my Direct3D Object, "pD3D" and Direct3D Device, "pD3DDevice".

Share this post


Link to post
Share on other sites
Advertisement
Yes I am using VS2010. I have been using it for like 2 years now and haven't come across any errors like this. Also, how do I check if I have set up my include paths correctly??

Share this post


Link to post
Share on other sites
I can help with the first error. The [color="#000000"]winmain[color="#666600"].[color="#000000"]cpp.
If you never wrote that file and its not in your directory then remove it from your project(however you do that in VS2010.

Share this post


Link to post
Share on other sites
Look at the preprocessed source (there is a compiler flag to emit it). Perhaps some errant #define or macro is causing this problem.

It is going to be long and ugly, but at least you'll be able to see what the compiler is seeing, and therefore what it is complaining about.

As a side note, your custom vertex header should have an include guard.

Share this post


Link to post
Share on other sites
syntax error : missing ';' before identifier 'pD3D'

That means the compiler didn't understand what a LPDIRECT3D9 is, which means it probably didn't manage to #include <d3d9.h> (As RobinsonUK hinted at).

To set up include paths in VS2008 (I imagine VS2010 is very similar):
1. Go to Tools menu -> Options
2. Select Projects and Solutions -> VC++ Directories
3. nder "Show directories for:" in the top right, change to "Include files"
4. Click the "New Line" button (Yellow folder with a starburst in the top right)
5. If there's no DirectX SDK paths there, type "C:\Program Files (x86)\Microsoft DirectX SDK (August 2009)\Include" (No quotes), or whatever the path to your DirectX SDK is.
6. Under "Show directories for:" in the top right, change to "Library files"
7. Click the "New Line" button (Yellow folder with a starburst in the top right)
8. If there's no DirectX SDK paths there, type "C:\Program Files (x86)\Microsoft DirectX SDK (August 2009)\Lib\x86" (No quotes), or whatever the path to your DirectX SDK is.
9. Click "OK" and then try compiling again.

If there's already DirectX SDK paths there, can you tell us what they are?</d3d9.h>

Share this post


Link to post
Share on other sites
I'm trying to look through the code. I've looked at the preprocessor directives and I really can't see what the problem is.

I have tried looking at this exact code, but in a different project that runs without any problems at all and the only difference is that I am not using the D3DX Library with a few less functions and data members declared. They are pretty much the same header file.

I've not exactly learnt what all of the preprocessor directives do, but I made a little effort to find out what the #ifndef, #define and #endif do when using them in a Header File. The #ifndef if I am correct checks to see if the identifier has been defined, if it hasn't then I use the #define directive to define that identifier which is DXMANAGER_H. I then end this so called #ifndef loop with the #endif directive.

I don't have that much knowledge on the preprocessor directives, the books I am using don't go into much depth about it so I don't know the full use of them.

EDIT: Hey Steve, I tried followed your instructions, but as soon as I get to the 2nd step and click on VC++ Directories, nothing comes up except for:

"VC++ Directories editing in Tools > Options has been deprecated.

VC++ Directories are now available as a user property sheet that is added by default to all projects. Please click '?' for more information."

If I do press on the '?', the MDSN site comes up.

Share this post


Link to post
Share on other sites
I followed your instructions, but going through the Properties Page dialog box. I typed in the directory file path and pressed OK. I compiled and it is still showing the same errors.

Share this post


Link to post
Share on other sites
I managed to sort my code out, not too sure why, but I was looking up error C4430 on MSDN and it showed some code which declared a class object, but wasn't of type int. It showed that same class object, but was declared as an int datatype. I tried this with my Direct3D Object and Device, I knew this wasn't going to make my code work because I was calling function under the Direct3D9 Library with those Direct3D objects. So I changed them back to Direct3D objects and devices and all of those weird errors dissappeared.

The only errors I was getting was a linker error which was to do with the timeGetTime function call, so I had to include the Windows Header File and the Winmm Library File in the Properties Page. I think I had a couple of other errors to do with function calls, but I sorted them out. Executed my program and it started working. I had to change a few things in my custom vertex structure object, I plotted some points wrongly which came out with a rotating mess on the screen. I was also using a Triangle List and not a Triangle Strip in my DrawPrimitive function call. I also wasn't able to call that same function within a for loop, not sure why, I tried many different approaches, but it wasn't showing my cube properly.

The only problem I am having now is that my cube is just black, whereas the cube in the example code is white, but the edges are different colors. I know I am only using one color at the moment and that's blue, but the whole cube is black including the faces.

EDIT: Ok, I managed to get it all sorted now. I was doing the exercises through my book and noticed I hadn't called the D3DXMatrixIdentity function, I actually couldn't remember what this function did, I looked it up and I was pretty sure that wasn't it as this would have nothing to do with setting colors to my object. I then spotted something in the example code which called the SetRenderState function three times, one for the Ambient Light, one for the Fill Mode and the other for the Lighting. I then knew that is what was causing the problem with my code, I hadn't set any lighting in the program or specified how to fill in my object so it was set to black by default. Put the function calls in and it works lol.


I do appreciate all the help people have offered, but I somehow fixed all the problems without really knowing 100% how to do it, but tried a few things about just in case and it seemed to work. So hopefully if this same error appears in the future, I will know what to do lol.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!