Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SFML2] [MAC] EXC_BAD_ACCESS loading images  (Read 1746 times)

0 Members and 1 Guest are viewing this topic.

JAssange

  • Full Member
  • ***
  • Posts: 104
    • View Profile
[SFML2] [MAC] EXC_BAD_ACCESS loading images
« on: April 08, 2011, 01:57:30 am »
My code compiles and runs perfectly on Windows however on Mac I'm getting the error "EXC_BAD_ACCESS" the first time I try to load a texture. The texture dimensions are powers of two and here is the stack trace:
Code: [Select]
#0 0x7fff83b223e2 in glGetIntegerv
#1 0x100092283 in sf::Image::GetMaximumSize at Image.cpp:539
#2 0x100094001 in sf::Image::CreateTexture at Image.cpp:600
#3 0x1000950f3 in sf::Image::LoadFromFile at Image.cpp:103
#4 0x10000c912 in cman::GetImage at cman.cpp:15
#5 0x10000b1cf in intro_load at main.cpp:81
#6 0x10000f708 in sf::priv::ThreadFunctorWithArg<void (*)(LoadFuncData*), LoadFuncData*>::Run at Thread.inl:48
#7 0x10024fae4 in sf::Thread::Run at Thread.cpp:83
#8 0x10025007c in sf::priv::ThreadImpl::EntryPoint at ThreadImpl.cpp:74
#9 0x7fff88cf54f6 in _pthread_start


Can I not load images from another thread on Mac or something?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
[SFML2] [MAC] EXC_BAD_ACCESS loading images
« Reply #1 on: April 08, 2011, 08:07:39 am »
You must instanciate a sf::Context to be able to call graphics functions from a thread.

This won't be necessary anymore when Hiura applies the latest modifications to the OS X part of the code.
Laurent Gomila - SFML developer

 

anything