C++ Hjälp!
Hej!
Jag föröker lära mig programmera, mitt första projekt är ett skjutsikte
som man kan använda i spel.
Det här är koden jag har kommit fram till:
// CH Test.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
bool xhair=true;
;-D3DVIEWPORT9 o;Viewport;
-ID3DXLine;*pLine;
-D3DXCreateLine(DEVICE, &pLine);
-DEVICE->GetViewport(&oViewport);
-void fillrgba(int x, int y, int w, int h, int r, int g, int b, int a)
;{
-D3DXVECTOR2 vLine[2];
-pLine->SetWidth( w );
-pLine->SetAntialias( false );
-pLine->SetGLLines( true );
-vLine[0].x = x + w/2;
-vLine[0].y = y;
-vLine[1].x = x + w/2;
-vLine[1].y = y + h;
-pLine->Begin( );
-pLine->Draw( vLine, 2, D3DCOLOR_RGBA( r, g, b, a ) );
-pLine->End( );
}
-//Then in endscene/begin/dip/present or a subdevice
-BYTE* bAlpha = (BYTE*)0x243D74F4; //cl_crosshairalpha
-if(xhair);{
-*bAlpha=0;
-fillrgba(oViewport.Width/2, o;Viewport.Height/2, 6, 6, 255, 0, 0, 255);
-{}else;{
-*bAlpha=255;
}
-if(GetAsyncKeyState(VK_F2)&1)xhair=!xhair;
När jag ska köra koden får jag 12 error meddelanden.
Här är dom:
1>------ Build started: Project: CH Test, Configuration: Debug Win32 ------
1>Compiling...
1>CH Test.cpp
1>c:\users\transqusion\documents\visual studio 2008\projects\ch test\ch test\ch test.cpp(6) : error C2059: syntax error : '-'
1>c:\users\transqusion\documents\visual studio 2008\projects\ch test\ch test\ch test.cpp(6) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\transqusion\documents\visual studio 2008\projects\ch test\ch test\ch test.cpp(7) : error C2059: syntax error : '-'
1>c:\users\transqusion\documents\visual studio 2008\projects\ch test\ch test\ch test.cpp(7) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\transqusion\documents\visual studio 2008\projects\ch test\ch test\ch test.cpp(8) : error C2059: syntax error : '-'
1>c:\users\transqusion\documents\visual studio 2008\projects\ch test\ch test\ch test.cpp(9) : error C2059: syntax error : '-'
1>c:\users\transqusion\documents\visual studio 2008\projects\ch test\ch test\ch test.cpp(10) : error C2059: syntax error : '-'
1>c:\users\transqusion\documents\visual studio 2008\projects\ch test\ch test\ch test.cpp(11) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\transqusion\documents\visual studio 2008\projects\ch test\ch test\ch test.cpp(27) : error C2059: syntax error : '-'
1>c:\users\transqusion\documents\visual studio 2008\projects\ch test\ch test\ch test.cpp(30) : error C2059: syntax error : '-'
1>c:\users\transqusion\documents\visual studio 2008\projects\ch test\ch test\ch test.cpp(30) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\transqusion\documents\visual studio 2008\projects\ch test\ch test\ch test.cpp(38) : fatal error C1004: unexpected end-of-file found
1>Build log was saved at "file://c:\Users\TransQusion\Documents\Visual Studio 2008\Projects\CH Test\CH Test\Debug\BuildLog.htm"
1>CH Test - 12 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Nu undrar jag om nån kan hjälpa mig!
Ifall nån skulle hjälpa mig skulle jag bli djupt tacksam!