<div dir="ltr"><div><div><div><div><div>Hi!<br></div>Using Lasarus 1.4.4 <br></div>I'm following the SDL tutorial at <br><a href="http://www.freepascal-meets-sdl.net/">http://www.freepascal-meets-sdl.net/</a><br></div>and get problems very fast.<br><br><br></div>looking at <a href="http://www.freepascal-meets-sdl.net/chapter-5-drawing-primitives/">http://www.freepascal-meets-sdl.net/chapter-5-drawing-primitives/</a><br></div><div>I have the code starting like this<br><br><br>program Chapter5_SDL2;<br><br>uses SDL2;<br><br>var<br>i : integer;<br>sdlWindow1 : PSDL_Window;<br>sdlRenderer : PSDL_Renderer;<br>sdlRect1 : PSDL_Rect;<br>sdlPoints1 : array[0..499] of PSDL_Point;<br><br>begin<br><br> //initilization of video subsystem<br> if SDL_Init( SDL_INIT_VIDEO ) < 0 then HALT;<br><br> sdlWindow1 := SDL_CreateWindow( 'Window1', 50, 50, 500, 500, SDL_WINDOW_SHOWN );<br> if sdlWindow1 = nil then HALT;<br> writeln('1');<br> sdlRenderer := SDL_CreateRenderer( sdlWindow1, -1, 0 );<br> writeln('2');<br> if sdlRenderer = nil then HALT; <br></div><div>and so on<br></div><div><br></div><div>However it crashes with runtime error 217 on line <br>sdlRenderer := SDL_CreateRenderer( sdlWindow1, -1, 0 );<br></div><div>I get '1' on the screen but not '2'<br><br><br><br>C:\bnl\svn\trunk\pascal\sdl-stuff>chapter5_sdl2.exe<br>1<br>Runtime error 217 at $000007FEFD28ADAD<br> $000007FEFD28ADAD<br> $000007FEF9417F69<br> $0000000000002D6E<br><br><br></div><div>if run from Lazarus, I get some assembler listing<br></div><div><br>.....<br><br>RaiseException <br>000007FEFD28AD70 4881ecc8000000 sub $0xc8,%rsp<br>000007FEFD28AD77 83e201 and $0x1,%edx<br>000007FEFD28AD7A 488d05efffffff lea -0x11(%rip),%rax # 0x7fefd28ad70 <RaiseException><br>000007FEFD28AD81 894c2420 mov %ecx,0x20(%rsp)<br>000007FEFD28AD85 33c9 xor %ecx,%ecx<br>000007FEFD28AD87 4889442430 mov %rax,0x30(%rsp)<br>000007FEFD28AD8C 89542424 mov %edx,0x24(%rsp)<br>000007FEFD28AD90 48894c2428 mov %rcx,0x28(%rsp)<br>000007FEFD28AD95 4d85c9 test %r9,%r9<br>000007FEFD28AD98 0f859a080100 jne 0x7fefd29b638 <ProcessIdToSessionId+200><br>000007FEFD28AD9E 894c2438 mov %ecx,0x38(%rsp)<br>000007FEFD28ADA2 488d4c2420 lea 0x20(%rsp),%rcx<br>000007FEFD28ADA7 ff15f3040400 callq *0x404f3(%rip) # 0x7fefd2cb2a0 <NlsUpdateLocale+4928><br>000007FEFD28ADAD 4881c4c8000000 add $0xc8,%rsp<br><br><br></div><div>and I have no clue where i crashes, but I presume it is in sdl2.dll somewhere.<br></div><div>Downloaded the latest 64 bit for win at <a href="http://sdl.org">sdl.org</a> (2.0.4)<br></div><div>searching throught the disk gives exactly 1 sdl2.dll<br></div><div><br>C:\>dir /s sdl2.dll<br> Directory of C:\bnl\bin<br>2016-01-02 11:59 1 230 336 SDL2.dll<br> 1 File(s) 1 230 336 bytes<br> Total Files Listed:<br> 1 File(s) 1 230 336 bytes<br> 0 Dir(s) 122 686 066 688 bytes free<br><br><br><br></div><div>Anyone has some ideas what to do.<br></div><div>Needless to say, google runtime error 217 gives no clear indication<br></div><div>on why it is complaining.<br></div><div><br></div><div>I had Lazarus 1.6 before, but downgraded because of <br></div><div>bug in databse interface reagrding floats.<br></div><div>(thread with subject "TPQConnection and float")<br><br><div><div><br><br clear="all"><div><div><br>-- <br><div class="gmail_signature">/Björn</div>
</div></div></div></div></div></div>