Du bist nicht angemeldet.
suxx-
unregistriert
weil du die Structuren vor ihrer Verwendung definieren musst sprich
Zitat von »-TheKilla-«
Ich danke dir erstmal für dieses Tutorial. Nur ich habe ein Problem. Und zwar habe ich
in die OpenGl32.cpp kopiert, nur ich bekomme dann trotzdem diese errors.
![]()
Quellcode
1 2 3 4 5 6 7 8 9 --------------------Konfiguration: opengl32 - Win32 Release-------------------- Kompilierung läuft... opengl32.cpp C:\Dokumente und Einstellungen\ischmael\Desktop\opengl32.cpp(248) : error C2146: Syntaxfehler : Fehlendes ';' vor Bezeichner 'menu' C:\Dokumente und Einstellungen\ischmael\Desktop\opengl32.cpp(248) : error C2501: 'menu_s' : Fehlende Speicherklasse oder Typbezeichner C:\Dokumente und Einstellungen\ischmael\Desktop\opengl32.cpp(248) : fatal error C1004: Unerwartetes Dateiende gefunden Fehler beim Ausführen von cl.exe. opengl32.dll - 3 Fehler, 0 Warnung(en)
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
typedef struct {
int count;
int maxcount;
bool active;
}menu_s;
typedef struct {
bool menu;
bool chair;
bool esp;
bool info;
bool enable;
}draw_s;
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Compiling... Command line warning D4002 : ignoring unknown option '/Op' Command line warning D4002 : ignoring unknown option '/Ob2' opengl32.cpp C:\wrapper unfair v1\Menü\vars.h(37) : error C2370: 'vp' : redefinition; different storage class C:\wrapper unfair v1\Menü\vars.h(18) : see declaration of 'vp' C:\wrapper unfair v1\Menü\vars.h(40) : error C2146: syntax error : missing ';' before identifier 'menu' C:\wrapper unfair v1\Menü\vars.h(40) : error C2501: 'menu_s' : missing storage-class or type specifiers C:\wrapper unfair v1\Menü\vars.h(40) : fatal error C1004: unexpected end of file found OtherOGL.cpp Generating Code... Error executing cl.exe. opengl32.dll - 4 error(s), 2 warning(s) |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
bool lamberttoggle=false;
bool wallhacktoggle=false;
bool asus=false;
bool wire=false;
bool dSky = false;
bool night=false;
bool crosshair = false;
float cross_size = 48.0f;
bool white=false;
bool bright=false;
bool hud=false;
bool keypress=false;
//zoom
bool zoo=false;
int zoom_lvl = 30;
// removes
int vp[4]; // Enthält Informationen über den Screen
GLfloat color[4];
bool bFlash = false;
bool bScope = false;
bool bSky = false; // Wenn ihr den Sky Remove benutzen wollt dann müsst ihr den bool entweder auf true setzten oder ein KeyBinding machen
bool bSmoke = false;
bool bClearbit = false;
bool bQuads = false;
//------------------ Menü
//Für die Das erstellen und ausgeben der Schrift
GLuint base;
HDC hDC;
bool FirstInit = false;
int viewportcount=0;
// Für die Keyverwaltung
int Last_Key=0;
// Informationen über die Bildschirm
static GLint vp[4];
// Init Der Strukturen
menu_s menu;
draw_s draw;
//--------------------- Menü
typedef struct {
int count;
int maxcount;
bool active;
}menu_s;
typedef struct {
bool menu;
bool chair;
bool esp;
bool info;
bool enable;
}draw_s;
//------------------ Menü ENde
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
bool lamberttoggle=false;// in der vars.h
void sys_glVertex3f (GLfloat x, GLfloat y, GLfloat z) // in opengl32.cpp
{
if(lamberttoggle)
{
(*orig_glColor3f)(1.0f, 1.0f, 1.0f); //Lambert
}
(*orig_glVertex3f) (x, y, z);
} // in opengl32.cpp
//--------------------------------------------------------
if(GetAsyncKeyState(VK_NUMPAD4)& (1==1)) //Lambert
{
lamberttoggle=!lamberttoggle;
}
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
// bei ---> void MenuUp()
case 4:
{
cvar.lamberttoggle=!cvar.lamberttoggle;
break;
}
//--------------------------------------
void DrawMenu(int x, int y)
{
char Entry[10][30];
sprintf(Entry[4]," - Lamberttoggle s",cvar.lamberttoggle?"On":"Off");
|
: error C2228: left of '.lamberttoggle' must have class/struct/union type|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
#ifndef HEADER_CVAR_H
#define HEADER_CVAR_H
//=======================================================================================
class CVARList
{
public:
// registrieren aller cvars beim prozessor und initialiesierten
void init();
public:
int asus;
int scope;
int smoke;
int sky;
int flash;
int wallhacktoggle;
int lambert;
int xqz;
int lamberttoggle;
int white;
int wire;
};
extern CVARList cvar;
#endif
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 |
glPrint(x,y-28,1.0f,0.5f,0.5f,1.0f,"------------------------");
glPrint(x,y-17,1.0f,0.5f,0.5f,1.0f,"- P3N!$ of spieletermine OGL -");
glPrint(x,y-6 ,1.0f,0.5f,0.5f,1.0f,"------------------------");
for (int i=1; i < menu.maxcount+1;i++) {
if (menu.count == i)
glPrint(x,y+(14 * i)+5 ,1.0f,1.0f,0.2f,0.2f,Entry[i]);
else
glPrint(x,y+(14 * i)+5 ,1.0f,1.0f,1.0f,1.0f,Entry[i]);
|
|
|
Quellcode |
1 2 3 4 |
void sys_glPrint(float x, float y, float z, float r, float g, float b, const char *fmt, ...)
{
char text[256];
va_list ap; // und so weiter
|
thunderstorm
unregistriert
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
GLvoid glPrint(const char *fmt, ...) // Custom GL "Print" Routine
{
char text[256]; // Holds Our String
va_list ap; // Pointer To List Of Arguments
if (fmt == NULL) // If There's No Text
return; // Do Nothing
va_start(ap, fmt); // Parses The String For Variables
vsprintf(text, fmt, ap); // And Converts Symbols To Actual Numbers
va_end(ap); // Results Are Stored In Text
glPushAttrib(GL_LIST_BIT); // Pushes The Display List Bits ( NEW )
glListBase(base - 32); // Sets The Base Character to 32 ( NEW )
glCallLists(strlen(text), GL_UNSIGNED_BYTE, text); // Draws The Display List Text ( NEW )
glPopAttrib(); // Pops The Display List Bits ( NEW )
}
|
|
|
Quellcode |
1 2 |
opengl32.cpp(320) : error C2664: 'glPrint' : cannot convert parameter 1 from 'int' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
|
suxx-
unregistriert
Zitat von »P3N!$«
Hmm ich werd einfach nicht schlau draus.
Ich verwende den wrapper den es zum download gibt.. und ich bekomme immer nen fehler.. egal wie ich es anstelle. Mit deinem code sagt der compilor das da:
![]()
Quellcode
1 2opengl32.cpp(320) : error C2664: 'glPrint' : cannot convert parameter 1 from 'int' to 'const char *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
|
|
Quellcode |
1 |
void glPrint(float x, float y, float r, float g, float b, const char *fmt) |
dann bin ich da doch einiges entfernt von.
Zitat
ich behaupte mal nu kommen 40-50 fragen was damit machen und was es überhaupt ist (und mal ne frage die kommen wird) Nein, dass kann man nicht inne cfg schreiben.
|
|
Quellcode |
1 2 |
1. opengl32.cpp(23) : error C2065: 'fmt' : undeclared identifier 2. opengl32.cpp(320) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 |
--------------------Configuration: opengl32 - Win32 Release-------------------- Compiling... Command line warning D4002 : ignoring unknown option '/Op' Command line warning D4002 : ignoring unknown option Creating library Release/opengl32.lib and object Release/opengl32.exp opengl32.obj : error LNK2001: unresolved external symbol "class CVARList cvar" (?cvar@@3VCVARList@@A) Release/opengl32.dll : fatal error LNK1120: 1 unresolved externals Error executing link.exe. opengl32.dll - 2 error(s), 12 warning(s) |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
#ifndef HEADER_CVAR_H
#define HEADER_CVAR_H
// =======================================================================================
class CVARList
{
public:
// registrieren aller cvars beim prozessor und initialiesierten
void init();
public:
int asus;
int scope;
int smoke;
int sky;
int flash;
int wallhacktoggle;
int lambert;
int xqz;
int lamberttoggle;
int white;
int wire;
};
extern CVARList cvar;
#endif
// Für die Keyverwaltung
int Last_Key=0;
typedef struct {
int count;
int maxcount;
bool active;
}menu_s;
typedef struct {
bool menu;
bool chair;
bool esp;
bool info;
bool enable;
}draw_s;
//Für die Das erstellen und ausgeben der Schrift
GLuint base;
HDC hDC;
bool FirstInit = false;
int viewportcount=0;
|
Dieser Beitrag wurde bereits 7 mal editiert, zuletzt von »dnadna« (08.12.2007, 18:59)