Hello, I've been having this error come up whenever I try to compile this code:
#include "stdafx.h"
#include "Strides.h"
int m_Stride;
bool chams = true;
bool onetime = true;
int main();
{
if (chams)
{
const BYTE bRed[60] = //red
{
0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0x00, 0x00, 0x50
}
const BYTE bGold[60] = //yellow
{
0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0x00, 0x00, 0x01
}
LPDIRECT3DTEXTURE8 texRed; //texture
LPDIRECT3DTEXTURE8 texYellow; //texture
HRESULT APIENTRY hkIDirect3DDevice8::BeginScene(void)
{
if(onetime)
{
//create our textures
onetime = false;
D3DXCreateTextureFromFileInMemory(m_pD3Ddev,(LPCVO ID)&bRed,60,&texRed) ;
D3DXCreateTextureFromFileInMemory(m_pD3Ddev,(LPCVO ID)&bGold,60,&texYellow);
}
return m_pD3Ddev->BeginScene();
}
hkIDirect3DDevice8:DrawIndexedPrimitive(D3DPRIMITIV ETYPE PrimitiveType,UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount)
if(m_Stride == 36)
{
m_pD3Ddev->SetRenderState(D3DRS_ZENABLE, false);
m_pD3Ddev->SetTexture(0, texRed);
m_pD3Ddev->SetRenderState(D3DRS_LIGHTING,false);
m_pD3Ddev->DrawIndexedPrimitive(PrimitiveType, minIndex, NumVertices, startIndex, primCount);
m_pD3Ddev->SetRenderState(D3DRS_ZENABLE, true);
m_pD3Ddev->SetTexture(0, texYellow);
m_pD3Ddev->SetRenderState(D3DRS_LIGHTING,false);
HRESULT APIENTRY hkIDirect3DDevice8:rawIndexedPrimitive(D3DPRIMITIV ETYPE PrimitiveType,UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount)
{
if(m_Stride == 32)
{
m_pD3Ddev->SetRenderState(D3DRS_ZENABLE, false);
m_pD3Ddev->SetTexture(0, texRed);
m_pD3Ddev->SetRenderState(D3DRS_LIGHTING,false);
m_pD3Ddev->DrawIndexedPrimitive(PrimitiveType, minIndex, NumVertices, startIndex, primCount);
m_pD3Ddev->SetRenderState(D3DRS_ZENABLE, true);
m_pD3Ddev->SetTexture(0, texYellow);
m_pD3Ddev->SetRenderState(D3DRS_LIGHTING,false);
return m_pD3Ddev->DrawIndexedPrimitive(PrimitiveType, minIndex, NumVertices, startIndex, primCount);
}
}
}
}
}
The error will come up at line 13... Which is where i begin the main function.
I have looked through this code many times and I can't seem to find anything wrong with it, I've moved brackets around, deleted some code, etc. But it still give me the same error.
(Hidden).cpp(13) : error C2447: '{' : missing function header (old-style formal list?)