FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Dima-san: Access Violation with SDL

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
Dima-san



Joined: 25 Mar 2007
Posts: 33
Location: Almaty, Kazakhstan

PostPosted: Fri Aug 03, 2007 11:21 am    Post subject: Reply with quote

Using tango 0.99RC3, dmd 1.018, and derelict r270, I'm getting access violating too when try to initialize SDL's video subsystem.
Code:

...
if ( SDL_InitSubSystem( SDL_INIT_VIDEO ) !is null ) {
    // never get here
}
...
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Fri Aug 03, 2007 5:08 pm    Post subject: Reply with quote

I split this into a separate topic because it is a separate problem, though I now see that you are probably making the same mistake as the other guy.

The only way I can get an access violation with this code is if I don't load the SDL shared library first. Are you doing that?

Code:

import derelict.sdl.sdl;

void main()
{
   DerelictSDL.load();
   SDL_InitSubSystem(SDL_INIT_VIDEO);
   SDL_Quit();
}

_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
Dima-san



Joined: 25 Mar 2007
Posts: 33
Location: Almaty, Kazakhstan

PostPosted: Sat Aug 04, 2007 12:00 pm    Post subject: Reply with quote

The access violation appears when I call SDL_InitSubSystem( SDL_INIT_VIDEO ) after calling DerelictSDL.load() and SDL_Init( SDL_INIT_NOPARACHUTE ).
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Sat Aug 04, 2007 9:18 pm    Post subject: Reply with quote

Works fine for me on Windows. Are you on Linux? Are you sure it's a Derelict issue and not an SDL issue, i.e., did you try the same code in C?
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
Dima-san



Joined: 25 Mar 2007
Posts: 33
Location: Almaty, Kazakhstan

PostPosted: Sun Aug 05, 2007 12:30 pm    Post subject: Reply with quote

My PC runs WinXP SP2. I haven't tried running this code in C. I 've tried to run two projects that make use of DerelictSDL and unfortunately none of them worked. Yage crashes for unknown reason (that must be an issue with model loading). The Arclib's Asteroids demo doesn't work because I haven't downloaded resources for it (yet).Laughing
Anyway, I'll try to figure out why SDL's crashing tommorow. I suppose, the reason behind crashing is the extreme curvature of my arms Embarassed
Though, I've tryed everything, and nothing worked Evil or Very Mad
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Sun Aug 05, 2007 7:04 pm    Post subject: Reply with quote

This is a long shot, but which version of SDL are you using?
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
Dima-san



Joined: 25 Mar 2007
Posts: 33
Location: Almaty, Kazakhstan

PostPosted: Mon Aug 06, 2007 11:39 am    Post subject: Reply with quote

I've been trying to run my app on a laptop -- and it worked! Very Happy It must be an issue with my PC, or Windows...
Concerning SDL version, I've used SDL 1.2.10 through 1.2.12.

Thanks for the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group