The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL2, Delphi and random exceptions
Rang


Joined: 05 Jun 2015
Posts: 13
I created win32 program with Forms in Delphi.

Initialization of SDL proceeds by button. SDL2 window is atached to panel object with SDL_CreateWindowFrom().

Program loading images to memory and creating textures for renderer. Then drawing them.

All of actions with SDL2 proceed in separated single thread, created with BeginThread.

And some times, randomly, not all time (or continuously), i catching exceptions in SDL2 dll.
When i try figure out where and what cause exceptions - i can't find what is wrong.
SDL_GetError() return nothing.

95% of exceptions i catch on SDL_CreateTextureFromSurface(), on initialization of images.
Other times it can be happened in SDL_RenderPresent() or in SDL_SetRenderTarget() - in drawing loop.

I checked thread id - it don't changed.
I checked inbound surfaces - all ok.

I'm at an impasse.

P.S. Windows 7 x64. SDL 2.0.4. Graphic card Radeon and integrated Intel (on PC and on notebook, problem is on both).
Rang


Joined: 05 Jun 2015
Posts: 13
Seems like textures are broken when sent them to SDL2. But not all and not specific.
I see that the pointer to texture is exists, some parameters are ok but something wrong.

From ~600 textures that can be happend on 10-th ... or on 543-th ...
On creating or on freeing.

Is there solutions how to check surface or texture structure\memory?

I use functions Get and Put pixels from\to surface, from old (1.2) sdlutils. Seems like them not changed. I thout that this was a problem, but when i turned off them - nothing changed.