Forum | | | |  Andreas Gaida | Hi! by me causes glEnableClientState in link with ~ GL_NORMAL_ARRAY a Program crash in XProfan as well as too with Profan2CPP. During The others Arrays itself without Problems enable let power this Ärger what very pity is because in link with glVertexPointer and glDrawArrays is it very quick with draw vieler Objects. i hope so can me of/ one help with the trouble.
If in the example code in the Procedure DrawGLScene the oGL(glEnableClientState,$8075) activate becomes crashes the program immediate with achieve the place ex. as attachment have I a complete Source with obj File appended .the Program reads The obj File one and position The Vertex dar ,The trouble place for Normalen is yet auskommentiert. at that enable this place in the proc DrawGLScene overthrows the program ex . for Help would I very grateful. CompileMarkSeparation
proc DrawGLScene
oGL(Clear)
oGL(Move, 0,-0.2, -1.0)
--------------------- Vierecke zeichnen -----------------------------------------------
oGL(glEnableClientState,$8075) Normale Array aktivieren $8075 = ~GL_NORMAL_ARRAY
oGL(glEnableClientState,$8074) Vertex Array aktivieren $8074 = ~GL_VERTEX_ARRAY
oGL(glNormalPointer,3,$140A,0,vertex_NF4#) Normale Array definieren $140A = ~GL_DOUBLE
oGL(glVertexPointer,3,$140A,0,vertex_VF4#) Vertex Array definieren
oGL(glDrawArrays,~GL_QUADS, 0 ,zähler_VF4&) Vertex Array zeichnen
oGL(glDisableClientState,$8074) glDisableClientState
oGL(glDisableClientState,$8075) Normale Array deaktivieren
--------------------- Dreicke zeichnen -----------------------------------------------
oGL(glEnableClientState,$8075) Normale Array aktivieren $8075
oGL(glEnableClientState,$8074) Vertex Array aktivieren $8074
oGL(glNormalPointer,3,$140A,0,vertex_NF3#) Normale Array definieren
oGL(glVertexPointer,3,$140A,0,vertex_VF3#) Vertex Array definieren
oGL(glDrawArrays,~GL_TRIANGLES, 0 ,zähler_VF3&) Vertex Array zeichnen
oGL(glDisableClientState,$8074) Vertex Array deaktivieren
oGL(glDisableClientState,$8075) Normale Array deaktivieren
---------------------------------------------------------------------------------------
oGL(Show)
GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, und GL_POLYGON.
endproc
MfG Andreas |
 | | | Athlon X2 4800 , 2GB Ram , GeForce 7800GT Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b | 06/01/07 ▲ |
| |
| |  | gives it a Beispielcode one others Herstellers z.B. in C or Pascal? it may be that the enable one normal-Arrays on another place called go must. experience so have I however unfortunately not. |
| | | | |
| |  Andreas Gaida | C example: glEnableClientState(GL_COLOR_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_VERTEX_ARRAY);
glColorPointer(3, GL_FLOAT, 0, color); glTexCoordPointer(2, GL_FLOAT, 0, texcoord); glNormalPointer(3, GL_FLOAT, 0, normal); glVertexPointer(3, GL_FLOAT, 0, vertex);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, all_indices);
Code [...] 
example 2 from another fountain : glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_NORMAL_ARRAY);
glVertexPointer(vcoordPerVertex,type,stride,vpointer); glNormalPointer(ncoordPerVertex,type,stride,npointer); glColorPointer(ccoordPerVertex,type,stride,cpointer); glTexCoordPointer(tcoordPerVertex,type,stride,tpointer);
glDrawArrays(geoMode, ridge, count); |
| | | Athlon X2 4800 , 2GB Ram , GeForce 7800GT Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b | 06/01/07 ▲ |
| |
| |  | Tjah! Perhaps should You you time xpse accustom. 
Have time with {$debug} your Sourcecode go through and its differently as You supra say - the program crashes on another place ex! here the statement from the xpsedebugmodus for your Program, The latest row is the row which really to that crash lead: CompileMarkSeparationREM ---FILE---
CLS
DATEN_INIT
PROCEED PROCEDURE { proc DATEN_INIT }/* LINE:32 {
DIM VERTEX_P# ,240000
DIM VERTEX_N# ,240000
DIM VERTEX_T# ,160000
DIM VERTEX_VF3#,120000
DIM VERTEX_VF4#,120000
DIM VERTEX_NF3#,120000
DIM VERTEX_NF4#,120000
DIM QUAD_A# ,120000
}
LADEN *test.obj*
PROCEED PROCEDURE { proc LADEN } /* LINE:122 {
DECLARE AB$
IF { IF @FILEEXISTS(DATEI$) } /* LINE:125 {
WINDOWTITLE *Lade OBJ Datei xxx*
...
WINDOWTITLE *Geladen *
}
}
OGL(*Init*, %HWND, 0, 0, 0, 1)
@SET(*oGLDepth*, 1000)
SETTIMER 20
WHILENOT { WHILENOT ENDE% } /* LINE:11 {
WAITINPUT
DRAWGLSCENE
PROCEED PROCEDURE { proc DRAWGLSCENE } /* LINE:16 {
OGL(*Clear*)
OGL(*Move*, 0,-0.2, -1.0)
OGL(*glEnableClientState*,$8075)
OGL(*glEnableClientState*,$8074)
OGL(*glVertexPointer*,3,$140A,0,VERTEX_VF4#)
OGL(*glDrawArr , 0 ,ZäHLER_VF4&)
|
| | | | |
| |  | Nachtrag: in the Übrigen müsstest You then neither any Konstanten define - there are already any definiert. You could simply same The Konstantenbezeichnung type. |
| | | | |
| |  Andreas Gaida | by me crashes it with : CompileMarkSeparation ex .with Windowtitle I get by then another spending thereafter not any more.
if oGL(glNormalPointer,3,$140A,0,vertex_NF4#) normal aray define $140A = ~GL_DOUBLE auskommentiert is crashes it with glDrawArrays ex otherwise with glNormalPointer having both command in the example auskommentiert.
where I do not understand wieso ?
have The Konstanten not uses because me Profan2CPP The not adopted has. |
| | | Athlon X2 4800 , 2GB Ram , GeForce 7800GT Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b | 06/01/07 ▲ |
| |
| |  | Windowttitle is imaginable unfit to that debuggen - there one sendmessage gesendet becomes. you become so means even not always The wirkliche Absturzstelle find. But if You the Windowtitle More credit schenkst as the real Debugoutput the xpse then go we together past talk must - hiernach can I then but not any more help. 
If you nevertheless my supposition listen want: there glDrawArrays crashes becomes the aray wrong befüllt his.
have The Konstanten not uses because me Profan2CPP The not adopted has.
who with XPSE operates has such Problems not. there's even a extra switch {$cpp}. |
| | | | |
| |  Andreas Gaida | I faith you Yes but I have in the quelltext 2 zeilen ausdokummentiert if both active are stürtzt it already with whom glVertexPointer commands ex it crashes too ex if glDrawArrays ausdokummentiert becomes what against a incorrect placement the befehls speaks or be I there so very on the holzweg
this code should former crash and if man glDrawArrays ausdokummentiert stürtzt it nevertheless ex
could you this part into example insert and it again debugen ? CompileMarkSeparation
proc DrawGLScene
oGL(Clear)
oGL(Move, 0,-0.2, -1.0)
--------------------- Vierecke zeichnen -----------------------------------------------
oGL(glEnableClientState,$8075) Normale Array aktivieren $8075 = ~GL_NORMAL_ARRAY
oGL(glEnableClientState,$8074) Vertex Array aktivieren $8074 = ~GL_VERTEX_ARRAY
oGL(glNormalPointer,3,$140A,0,vertex_NF4#) Normale Array definieren $140A = ~GL_DOUBLE
oGL(glVertexPointer,3,$140A,0,vertex_VF4#) Vertex Array definieren
oGL(glDrawArrays,~GL_QUADS, 0 ,zähler_VF4&) Vertex Array zeichnen
oGL(glDisableClientState,$8074) glDisableClientState
oGL(glDisableClientState,$8075) Normale Array deaktivieren
--------------------- Dreicke zeichnen -----------------------------------------------
oGL(glEnableClientState,$8075) Normale Array aktivieren $8075
oGL(glEnableClientState,$8074) Vertex Array aktivieren $8074
oGL(glNormalPointer,3,$140A,0,vertex_NF3#) Normale Array definieren
oGL(glVertexPointer,3,$140A,0,vertex_VF3#) Vertex Array definieren
oGL(glDrawArrays,~GL_TRIANGLES, 0 ,zähler_VF3&) Vertex Array zeichnen
oGL(glDisableClientState,$8074) Vertex Array deaktivieren
oGL(glDisableClientState,$8075) Normale Array deaktivieren
---------------------------------------------------------------------------------------
oGL(Show)
endproc
|
| | | Athlon X2 4800 , 2GB Ram , GeForce 7800GT Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b | 06/01/07 ▲ |
| |
| |  | Why do You not simply self? 
Gekürzter statement - unteres end is Programmabbruch: CompileMarkSeparationOGL(*Init*, %HWND, 0, 0, 0, 1)
@SET(*oGLDepth*, 1000)
SETTIMER 20
WHILENOT { WHILENOT ENDE% }/* LINE:11 {
WAITINPUT
DRAWGLSCENE
PROCEED PROCEDURE { proc DRAWGLSCENE } /* LINE:16 {
OGL(*Clear*)
OGL(*Move*, 0,-0.2, -1.0)
OGL(*glEnableClientState*,$8075)
OGL(*glEnableClientState*,$8074)
OGL(*glNormalPointer*,3,$140A,0,VERTEX
|
| | | | |
| |  Andreas Gaida | thanks nice . thought me To I with the the debugen on it have would longer last and so siehste too same I my . If I the right see is it means still the glNormalPointer commands the everything stopt .
have You or anyone else a idea wieso the spin it'll well not on OpenGL yourself liegenoder where make I a stupid Error.
otherwise over again viellen Thanks for Help.
MfG Andreas |
| | | Athlon X2 4800 , 2GB Ram , GeForce 7800GT Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b | 06/01/07 ▲ |
| |
| |  | well there's a reason for - The data The You commit are falser structure, you become therefore just a such from you beschriebenen stupid Error make. *g* |
| | | | |
| |  Andreas Gaida | here have I The data for Normalen into same structure brought as the Vertex data but the commands crashes still ex . have The same data as normal uses How for the rectangle ought to but not the program to that crash bring hösten strange looks but the formatierung is the same How tappt im dunkeln with draw the data functions. data go in the daten_init initialized.
So I go too most of it from the the Error me lying but in this drop catch I slow on it To doubt. true but nevertheless very glad above if one me a Error aufzeigen could . CompileMarkSeparationDeclare Dateiname$,Datei$,ab$,rückgabe&,ende%
Declare vertex_P#,vertex_N#,vertex_T#,vertex_VF3#,vertex_VF4#,quad_A#
Declare zähler_P&,zähler_N&,zähler_T&,zähler_F&,zähler_VF3&,zähler_VF4&,vertex_NF3#,vertex_NF4#,zähler_NF4&
cls
daten_init
oGL(Init, %hWnd, 0, 0, 0, 1)
@Set(oGLDepth, 1000)
setTimer 20 max. 50 Frames /sek.
WhileNot ende%
WaitInput
DrawGLScene
EndWhile
ende_init
proc DrawGLScene
oGL(Clear)
oGL(Move, 0,-0.0, -5.0)
--------------------- Vierecke zeichnen -----------------------------------------------
oGL(glEnableClientState,~GL_NORMAL_ARRAY) Normale Array aktivieren $8075 = ~GL_NORMAL_ARRAY
oGL(glEnableClientState,~GL_VERTEX_ARRAY) Vertex Array aktivieren $8074 = ~GL_VERTEX_ARRAY
oGL(glNormalPointer,3,~GL_DOUBLE,0,vertex_NF4#) Normale Array definieren $140A = ~GL_DOUBLE
oGL(glVertexPointer,3,~GL_DOUBLE,0,vertex_NF4#) Vertex Array definieren
oGL(glDrawArrays,~GL_QUADS, 0 ,zähler_VF4&) Vertex Array zeichnen
oGL(glDisableClientState,$8074) glDisableClientState
oGL(glDisableClientState,$8075) Normale Array deaktivieren
oGL(Show)
endproc
proc daten_init
Dim vertex_P# ,240000
Dim vertex_N# ,240000
Dim vertex_T# ,160000
Dim vertex_VF3#,120000
Dim vertex_VF4#,120000
Dim vertex_NF3#,120000
Dim vertex_NF4#,120000
Dim quad_A# ,120000
-------Vertex Array wird gefüllt ein Viereck--------------
Float vertex_VF4#, 0 = 0.0
Float vertex_VF4#, 8 = 1.0
Float vertex_VF4#, 16 = 1.0
Float vertex_VF4#, 24 = 0.0
Float vertex_VF4#, 32 = 0.0
Float vertex_VF4#, 40 = 1.0
Float vertex_VF4#, 48 = 1.0
Float vertex_VF4#, 56 = 0.0
Float vertex_VF4#, 64 = 1.0
Float vertex_VF4#, 72 = 1.0
Float vertex_VF4#, 80 = 1.0
Float vertex_VF4#, 88 = 1.0
zähler_VF4& = 4
-------Normal Vertex Array wird gefüllt---------------------
Float vertex_NF4#, 0 = 0.0
Float vertex_NF4#, 8 = 1.0
Float vertex_NF4#, 16 = 1.0
Float vertex_NF4#, 24 = 0.0
Float vertex_NF4#, 32 = 0.0
Float vertex_NF4#, 40 = 1.0
Float vertex_NF4#, 48 = 1.0
Float vertex_NF4#, 56 = 0.0
Float vertex_NF4#, 64 = 1.0
Float vertex_NF4#, 72 = 1.0
Float vertex_NF4#, 80 = 1.0
Float vertex_NF4#, 88 = 1.0
zähler_NF4& = 4
endproc
proc ende_init
Dispose vertex_P#
Dispose vertex_N#
Dispose vertex_T#
Dispose vertex_VF3#
Dispose vertex_VF4#
Dispose vertex_NF3#
Dispose vertex_NF4#
Dispose_A#
endproc
|
| | | Athlon X2 4800 , 2GB Ram , GeForce 7800GT Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b | 06/01/07 ▲ |
| |
|
AnswerThemeninformationenthis Topic has 3 subscriber: |