OpenGL unter Ubuntu 9.10 x64 mit PB 4.41
Verfasst: 03.02.2010 02:32
Hallo.
Bei mir kommt bei der Ausführung des folgenden Codes ein Fehler.
Die Fehlermeldung erscheint dann in der Konsole, von der ich die IDE gestartet habe.
Also Subsystem habe ich natürlich opengl verwendet.
Meine Grafikkarte ist eine NVidia Quadro NVS 140M mit dem aktuellen proprietären Treiber der Version 185 von NVidia.
Sorry, dass ich den Code jetzt nicht mehr gekürzt habe...
Bei mir kommt bei der Ausführung des folgenden Codes ein Fehler.
Code: Alles auswählen
#SUBDIVS=40
Structure Point2D
x.w
y.w
EndStructure
;---------Interpolating Splines-----------
Procedure AbsLNG(a.l)
If a >> 31
a * -1
EndIf
ProcedureReturn a
EndProcedure
Procedure Mod(a, b)
Erg.l = a - a / b * b
If a >> 31 : Erg + AbsLNG(b) : EndIf
ProcedureReturn Erg
EndProcedure
Procedure.w InterpolateSpline (tTime.f,tpx1.f,tpy1.f,tpx2.f,tpy2.f,tpx3.f,tpy3.f,tpx4.f,tpy4.f)
Shared Final.Point2D
tTime2.f = tTime * tTime
tTime3.f = tTime2 * tTime
;--------------------------------------------------
tpOneX= (-tpx1 + 3 * tpx2 - 3 * tpx3 + tpx4) * tTime3
tpOneY= (-tpy1 + 3 * tpy2 - 3 * tpy3 + tpy4) * tTime3
;--------------------------------------------------
tpTwoX= (2 * tpx1 - 5 * tpx2 + 4 * tpx3 - tpx4) * tTime2
tpTwoY= (2 * tpy1 - 5 * tpy2 + 4 * tpy3 - tpy4) * tTime2
;--------------------------------------------------
tpThreeX=(-tpx1 + tpx3) * tTime
tpThreeY=(-tpy1 + tpy3) * tTime
;--------------------------------------------------
tpFourX= (2 * tpx2)
tpFourY= (2 * tpy2)
;==================================================
Final\x=(tpOneX+tpTwoX+tpThreeX+tpFourX)/2
Final\y=(tpOneY+tpTwoY+tpThreeY+tpFourY)/2
;--------------------------------------------------
EndProcedure
InitSprite()
InitKeyboard()
InitMouse()
Width = 400
Height = 300
winId.i = OpenWindow(0, 0, 0, Width, Height, "Cuttmull-Rom-Splines", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
If OpenWindowedScreen(winId, 0, 0, Width, Height, 0, 0, 0)
NewList PointList.Point2D()
CreateSprite(0,10,10)
StartDrawing(SpriteOutput(0))
Circle(5,5,5,RGB(255,155,155))
StopDrawing()
Repeat
ExamineKeyboard()
If ExamineMouse()
xm=MouseX()
ym=MouseY()
If MouseButton(1)<>0
AddElement(PointList())
PointList()\x=xm
PointList()\y=ym
EndIf
EndIf
Repeat
ExamineMouse()
Until MouseButton(1)=0
FlipBuffers()
ClearScreen(RGB(0,0,0))
StartDrawing(ScreenOutput())
DrawingMode(1)
FrontColor(RGB(255,255,255))
StopDrawing()
c=ListSize(PointList())
FirstElement(PointList())
For n=1 To c
StartDrawing(ScreenOutput())
Circle(PointList()\x,PointList()\y,5,RGB(255,0,0))
StopDrawing()
NextElement(PointList())
Next
DisplaySprite(0,xm-5,ym-5)
Delay(1)
If C>1
FirstElement(PointList())
Dim p.Point2D(100)
For n=1 To C
p(n)\x=PointList()\x
p(n)\y=PointList()\y
NextElement(PointList())
Next
xold = -1000
yold = -1000
If StartDrawing(ScreenOutput())
For n=1 To C
t0 = mod((n - 2 + C) , C + 1)
t1 = n
t2 = Mod(n, C) + 1
t3 = mod((n + 1),C) + 1
For m=1 To #SUBDIVS
Time.f=(m-1.0)/#SUBDIVS
InterpolateSpline(Time,p(t0)\x,p(t0)\y,p(t1)\x,p(t1)\y,p(t2)\x,p(t2)\y,p(t3)\x,p(t3)\y)
If xold <> -1000 Or yold <> -1000
LineXY(xold, yold, Final\x, Final\y, RGB(255,255,255))
EndIf
xold = Final\x
yold = Final\y
Next
Next
StopDrawing()
EndIf
ExamineKeyboard()
EndIf
Until KeyboardPushed(#PB_Key_Escape)
EndIfCode: Alles auswählen
nicolas@nicolas-laptop:~/programme/purebasic/compilers$ ./purebasic
*** glibc detected *** /home/nicolas/Dokumente/purebasic/purebasic_compilation0.out: double free or corruption (!prev): 0x00000000025e3dd0 ***
======= Backtrace: =========
/lib/libc.so.6[0x7f38b3773dd6]
/lib/libc.so.6(cfree+0x6c)[0x7f38b377874c]
/usr/lib/tls/libnvidia-tls.so.1[0x7f38b1d9aa3b]
======= Memory map: ========
00400000-0044e000 r-xp 00000000 08:07 90938 /home/nicolas/Dokumente/purebasic/purebasic_compilation0.out
0064d000-0064f000 r-xp 0004d000 08:07 90938 /home/nicolas/Dokumente/purebasic/purebasic_compilation0.out
0064f000-00652000 rwxp 0004f000 08:07 90938 /home/nicolas/Dokumente/purebasic/purebasic_compilation0.out
00652000-006b4000 rwxp 00000000 00:00 0
02497000-02635000 rwxp 00000000 00:00 0 [heap]
40bd9000-40bdb000 rwxp 00000000 00:0f 1740 /dev/zero
41fd4000-42052000 rwxp 00000000 00:0f 1740 /dev/zero
7f38a4000000-7f38a4021000 rwxp 00000000 00:00 0
7f38a4021000-7f38a8000000 ---p 00000000 00:00 0
7f38a8c8b000-7f38a8cdc000 r-xp 00000000 08:06 41972 /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf
7f38a8cdc000-7f38a8cde000 r-xp 00000000 08:06 15278 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
7f38a8cde000-7f38a8edd000 ---p 00002000 08:06 15278 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
7f38a8edd000-7f38a8ede000 r-xp 00001000 08:06 15278 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
7f38a8ede000-7f38a8edf000 rwxp 00002000 08:06 15278 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
7f38a8edf000-7f38a8ee0000 r-xs 00000000 08:06 119454 /var/cache/fontconfig/c05880de57d1f5e948fdfacc138775d9-x86-64.cache-2
7f38a8ee0000-7f38a8ee9000 r-xs 00000000 08:06 119451 /var/cache/fontconfig/945677eb7aeaf62f1d50efc3fb3ec7d8-x86-64.cache-2
7f38a8ee9000-7f38a8eeb000 r-xs 00000000 08:06 119452 /var/cache/fontconfig/99e8ed0e538f840c565b6ed5dad60d56-x86-64.cache-2
7f38a8eeb000-7f38a8eee000 r-xs 00000000 08:06 119462 /var/cache/fontconfig/f24b2111ab8703b4e963115a8cf14259-x86-64.cache-2
7f38a8eee000-7f38a8ef1000 r-xs 00000000 08:06 119460 /var/cache/fontconfig/e383d7ea5fbe662a33d9b44caf393297-x86-64.cache-2
7f38a8ef1000-7f38a8ef5000 r-xs 00000000 08:06 101016 /var/cache/fontconfig/6eb3985aa4124903f6ff08ba781cd364-x86-64.cache-2
7f38a8ef5000-7f38a8ef6000 r-xs 00000000 08:06 119446 /var/cache/fontconfig/4c73fe0c47614734b17d736dbde7580a-x86-64.cache-2
7f38a8ef6000-7f38a8efb000 r-xs 00000000 08:06 119439 /var/cache/fontconfig/062808c12e6e608270f93bb230aed730-x86-64.cache-2
7f38a8efb000-7f38a8eff000 r-xs 00000000 08:06 119453 /var/cache/fontconfig/a755afe4a08bf5b97852ceb7400b47bc-x86-64.cache-2
7f38a8eff000-7f38a8f08000 r-xs 00000000 08:06 94428 /var/cache/fontconfig/6d41288fd70b0be22e8c3a91e032eec0-x86-64.cache-2
7f38a8f08000-7f38a8f18000 r-xs 00000000 08:06 119440 /var/cache/fontconfig/0f34bcd4b6ee430af32735b75db7f02b-x86-64.cache-2
7f38a8f18000-7f38a8f19000 r-xs 00000000 08:06 119444 /var/cache/fontconfig/4794a0821666d79190d59a36cb4f44b5-x86-64.cache-2
7f38a8f19000-7f38a8f47000 r-xs 00000000 08:06 101086 /var/cache/fontconfig/365b55f210c0a22e9a19e35191240f32-x86-64.cache-2
7f38a8f47000-7f38a8f49000 r-xs 00000000 08:06 119442 /var/cache/fontconfig/2c5ba8142dffc8bf0377700342b8ca1a-x86-64.cache-2
7f38a8f49000-7f38a8f53000 r-xs 00000000 08:06 119457 /var/cache/fontconfig/d52a8644073d54c13679302ca1180695-x86-64.cache-2
7f38a8f53000-7f38a8f5e000 r-xs 00000000 08:06 101017 /var/cache/fontconfig/e13b20fdb08344e0e664864cc2ede53d-x86-64.cache-2
7f38a8f5e000-7f38a8f60000 r-xs 00000000 08:06 101085 /var/cache/fontconfig/7ef2298fde41cc6eeb7af42e48b7d293-x86-64.cache-2
7f38a8f60000-7f38a8f6c000 r-xp 00000000 08:06 82448 /usr/share/locale-langpack/de/LC_MESSAGES/glib20.mo
7f38a8f6c000-7f38a916c000 rwxs 13608e000 00:0f 6061 /dev/nvidia0
7f38a916c000-7f38a926c000 rwxs 11f065000 00:0f 6061 /dev/nvidia0
7f38a926c000-7f38a92ac000 rwxs 124031000 00:0f 6061 /dev/nvidia0
7f38a92ac000-7f38a92cc000 rwxs 1209cd000 00:0f 6061 /dev/nvidia0
7f38a92cc000-7f38a93d4000 rwxp 00000000 00:00 0
7f38a93d4000-7f38a93f5000 rwxs 00000000 00:09 0 /SYSV00000000 (deleted)
7f38a93f5000-7f38a9418000 r-xp 00000000 08:06 10719 /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so
7f38a9418000-7f38a9617000 ---p 00023000 08:06 10719 /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so
7f38a9617000-7f38a9618000 r-xp 00022000 08:06 10719 /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so
7f38a9618000-7f38a9619000 rwxp 00023000 08:06 10719 /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so
7f38a9619000-7f38a9621000 r-xp 00000000 08:06 7039 /usr/lib/libltdl.so.7.2.0
7f38a9621000-7f38a9821000 ---p 00008000 08:06 7039 /usr/lib/libltdl.so.7.2.0
7f38a9821000-7f38a9822000 r-xp 00008000 08:06 7039 /usr/lib/libltdl.so.7.2.0
7f38a9822000-7f38a9823000 rwxp 00009000 08:06 7039 /usr/lib/libltdl.so.7.2.0
7f38a9823000-7f38a9830000 r-xp 00000000 08:06 7320 /usr/lib/libtdb.so.1.1.5Meine Grafikkarte ist eine NVidia Quadro NVS 140M mit dem aktuellen proprietären Treiber der Version 185 von NVidia.
Sorry, dass ich den Code jetzt nicht mehr gekürzt habe...
