English
Forum

OpenGL glDrawArrays Command problem

 

Andreas
Gaida
Hi!
have a problem with "Riched somehow I get it since many Meet and internet Search not so to that functions How it it should. have already couple dozen Varationen attempts without success Perhaps see I only whom woods to Lauter Bäumen not
I would very grateful for Help the trouble.

Mfg
Andreas
CompileMarkSeparation
Beispielcode des Problem :
Declare Dateiname$,Datei$,ab$,rückgabe&,ende%,byt_count&
Declare vertex_P#,vertex_N#,vertex_T#,vertex_F3#,vertex_F4#,quad_A#
Declare zähler_P&,zähler_N&,zähler_T&,zähler_F&,zähler_F3&,zähler_F4&
daten_init   Initialisiert  Bereiche und füllt sie mit Daten
cls
oGL(Init, %hWnd, 0, 0, 0, 1)
@Set(oGLDepth, 1000)
oGL(glEnableClientState,~GL_VERTEX_ARRAY)
print oGL(glIsEnabled,~GL_VERTEX_ARRAY)
oGL(glVertexPointer,3,~GL_FLOAT,0,@Addr(quad_A#))
setTimer 20  max. 50 Frames /sek.

WhileNot ende%

    WaitInput
    DrawGLScene

EndWhile

ende_init

proc DrawGLScene

    oGL(Clear)
    oGL(Move, 0,0, -4)
    quad               wenn aktiviert zeigt Quadrat an wie es aussehen soll
    oGL(glDrawArrays,~GL_QUADS, 0, 12)  soll Quadrat zeichnen aus einen Bereich heraus
    oGL(Show)

endproc

proc quad

    rückgabe& =oGL(glBegin,~GL_QUADS)
    oGL(glVertex3f,@Float(quad_A#, 0),@Float(quad_A#, 8),@Float(quad_A#, 16))
    oGL(glVertex3f,@Float(quad_A#, 24),@Float(quad_A#, 32),@Float(quad_A#, 40))
    oGL(glVertex3f,@Float(quad_A#, 48),@Float(quad_A#, 56),@Float(quad_A#, 64))
    oGL(glVertex3f,@Float(quad_A#, 72),@Float(quad_A#, 80),@Float(quad_A#, 88))
    rückgabe& = oGL(glEnd)

endproc

proc daten_init

    Dim vertex_P# ,24000000
    Dim vertex_N# ,24000000
    Dim vertex_T# ,16000000
    Dim vertex_F3#,12000000
    Dim vertex_F4#,12000000
    Dim quad_A#   ,12000000
    byt_count& = 0  Wenn 4  Zeigt  glDrawArrays was an aber nicht das was es soll
    Float quad_A#, (0 +byt_count&)  =  0.0
    Float quad_A#, (8 +byt_count&)  =  1.0
    Float quad_A#, (16+byt_count&)  =  1.0
    Float quad_A#, (24+byt_count&)  =  0.0
    Float quad_A#, (32+byt_count&)  =  0.0
    Float quad_A#, (40+byt_count&)  =  1.0
    Float quad_A#, (48+byt_count&)  =  1.0
    Float quad_A#, (56+byt_count&)  =  0.0
    Float quad_A#, (64+byt_count&)  =  1.0
    Float quad_A#, (72+byt_count&)  =  1.0
    Float quad_A#, (80+byt_count&)  =  1.0
    Float quad_A#, (88+byt_count&)  =  1.0

endproc

proc ende_init

    Dispose vertex_P#
    Dispose vertex_N#
    Dispose vertex_T#
    Dispose vertex_F3#
    Dispose vertex_F4#
    Dispose quad_A#
ass=s4 href='./../../function-references/XProfan/endproc/'>endproc

Administratorische Note: for Source code ask the CODE-day using.
 
Athlon X2 4800 , 2GB Ram , GeForce 7800GT
Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b
05/27/07  
 




Frank
Abbing
there go You well wrong to. How I it understood have, must You for a display-list using:

[web]https://wiki.delphigl.com/index.php/Displaylisten[/web]
with glNewList a new list started, these fill and then with glCallList Show.
Roland has but display-lists installed. Perhaps should You these using, instead of yourself which by API nachzubauen.
 
05/27/07  
 




Andreas
Gaida
Hi!
glDrawArrays can in Displaylisten vorkommen.
but its task is it Vertex Data from Arrays quick from the main memory To draw.
Z.B can with a appeal 10000 Dreiecke at a single blow draw or in a Displayliste insert
Displaylisten go in memory the Grafikkarte held and are very quick but unfortunately suit tappt im dunkeln itself only for static Objects and the Space the Speichers is unfortunately terminable wants one now Animationen create
need is a speedy Possibility many 3D data new To draw.
these method:
rückgabe& =oGL(glBegin,~GL_QUADS)
oGL(glVertex3f,@Float(quad_A#, 0),@Float(quad_A#, 8),@Float(quad_A#, 16))
oGL(glVertex3f,@Float(quad_A#, 24),@Float(quad_A#, 32),@Float(quad_A#, 40))
oGL(glVertex3f,@Float(quad_A#, 48),@Float(quad_A#, 56),@Float(quad_A#, 64))
oGL(glVertex3f,@Float(quad_A#, 72),@Float(quad_A#, 80),@Float(quad_A#, 88))
rückgabe& = oGL(glEnd)
is for simply too slow ,glDrawArrays müste at least 10 time so quick his unless yet plenty faster .
unfortunately wisely I do not wieso The umsetzung the C Examples to XProfan not functions

C example :
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, vertex);
glDrawArrays(GL_TRIANGLES, 0, 6);

Ganzer Queltext:
[...] 

MfG
Andreas
 
Athlon X2 4800 , 2GB Ram , GeForce 7800GT
Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b
05/27/07  
 




Andreas
Gaida
Hi!
can me Perhaps someone say as data the C Arrays in XProfan exactly nachgebildet go
can(must byte selfsame order in memory having) or which position each pieces the C Arrays in a area receive would.

for these Information would I very grateful.

C aray :
GLfloat vertex[4][3]={{-5.0f, 5.0f, 0.0f},
{-5.0f, -5.0f, 0.0f },
{5.0f, -5.0f, 0.0f },
{5.0f, 5.0f, 0.0f }};

MfG
Andreas
 
Athlon X2 4800 , 2GB Ram , GeForce 7800GT
Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b
05/29/07  
 



well simply 8 byte per Float! 8x4x3
CompileMarkSeparation
declare a#
dim a#,96
float a#, 0 =  blub
float a#, 8 =  blub
float a#, 16 =  blub
 
05/29/07  
 




Andreas
Gaida
THX

On these manner have I it already attempts

Dim quad_A# ,120000
byt_count& = 0
Float quad_A#, (0 +byt_count&) = 0.0
Float quad_A#, (8 +byt_count&) = 1.0
Float quad_A#, (16+byt_count&) = 1.0
Float quad_A#, (24+byt_count&) = 0.0
Float quad_A#, (32+byt_count&) = 0.0

have no idea and so the "Riched not functions
have me yet on The hope clung that I the aray wrong equips have
but the is so well frail.

MfG
Andreas
 
Athlon X2 4800 , 2GB Ram , GeForce 7800GT
Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b
05/30/07  
 



Mach time one lauffähiges Minimalbeispiel - from the too obviously is How You, the aray commit. and Codes Please always with
CompileMarkSeparation[/CODE] mark!
 
05/30/07  
 




Andreas
Gaida
the first Program this Treads is the example Program
in the Procedure daten_init go the aray The pertinent data transfer.
The Procedure quad shows as they activate becomes as ausehen ought to.
unfortunately klapt it with the others method with glDrawArrays not the same to drawing .
if I whom first Float worth the Arrays of 0.0 on 1.0 change draw glDrawArrays something but not the right.
of these code becomes the aray the "Riched available set:
CompileMarkSeparation
yet is it I do not been successful The data in the aray so anzulegen that I the same ergebniss get How with the quad Procedure.though I already a great many different orders attempts have and so
I do not wisely whether I as a Error make or the Perhaps in Profan lying .
 
Athlon X2 4800 , 2GB Ram , GeForce 7800GT
Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b
05/30/07  
 



Try time with Doubles instead of with Floats!
 
05/30/07  
 



Nachtrag I had here warscheinlich in the OGL-area a OGL-Source posted which to this principle a whole scene draw in the one itself too can move. even with reflection on the ground etc - look time in the OGL-area to Codes of me - Perhaps hilfts.
 
05/30/07  
 




Andreas
Gaida
OK will be to whom Codes look
viellen Thanks

MfG
Andreas
 
Athlon X2 4800 , 2GB Ram , GeForce 7800GT
Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b
05/30/07  
 




Andreas
Gaida
trouble resolved
Vielen Thanks IF
the hint with the Doubles has it brought do not have knew
the the C float only 4 Bytes has and went from the XProfan 8 Bytes from the muste Yes
Murks give

MfG
Andreas
 
Athlon X2 4800 , 2GB Ram , GeForce 7800GT
Windows XP Pro , XProfan 10 und 11 , Profan2Cpp 1.6b
05/31/07  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.016 Views

Untitledvor 0 min.
H.Brill05/28/23
Sven Bader08/05/21
HofK05/28/15
funkheld03/31/12

Themeninformationen

this Topic has 3 subscriber:

Andreas Gaida (7x)
iF (4x)
Frank Abbing (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie