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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - jerryd

Pages: 1 [2]
16
Graphics / Passing an SFML handle to a function
« on: May 07, 2013, 10:25:00 pm »
SFML forum,
  SFML 1.6  Visual C++ 2010

 I have some working SFML programs and need to find out how
 to pass a handle to a function.
int main()
{
        sf::RenderWindow Screen(sf::VideoMode(640, 480, 16), "SFML Window");
-
???? function(Screen);
-
        return EXIT_SUCCESS;
} // end of main


???? function(sf::???)
{
        -
        want to do some "Screen" commands in this function
        -
        -
return ???
} // end function(sf:???)
 

 How do I do this?

jerryd

17
Audio / sfml-audio-d.lib causes openal32.dll error
« on: May 05, 2013, 07:34:48 am »
SFML forum,
 SFML1.6   Visual C++ 2010

 I'm putting sounds in a working program for the first time.

 My code compiles OK if I put sfml-audio-d.dll in
 Linker > Input > Additional Dependencies.

 But then when I run it I get the error:
 This application has failed to start because openal32.dll was not found.

 I have tried #include <path to the openal.dll file>
 but then I get a whole screen full of errors when compiling.
 I also get a Microsoft Package Server error window saying
 "Micorsoft(R) Visual C++ Package Server has encounted a problem
 and needs to close".

 I have other programs running OK but without any sound code.

 I have read a few web sites about openal32.dll but couldn't
 find a solution for this.

 Any Suggestions?

jerryd


18
Graphics / SubRect Problem
« on: May 05, 2013, 03:18:20 am »
SFML forum,
 SFML 1.6  Visual C++ 2010

 I have an png that is 64 x 320 and contains 5 sprite pictures.
 1 2 3 4    the last one is blank.

 If I use:
 Numbers.SetSubRect(sf::IntRect(0,0,63,63));
 Screen.Draw(Numbers);
 a 1 is dispayed.

 If I use:
 Numbers.SetSubRect(sf::IntRect(64,64,127,127));
 Screen.Draw(Numbers);
 nothing is dispayed.

 If I use:
 Numbers.SetSubRect(sf::IntRect(0,0,127,127));
 Screen.Draw(Numbers);
 1 2 is dispayed.

 etc.......

 I have successfully used the same png file in another IDE
 where all I have to do is set the frame number.

 I have attached the .png file.

 Any suggestions?

jerryd


[attachment deleted by admin]

19
Graphics / setOrigin fails
« on: May 03, 2013, 04:30:30 am »
SFML forum,

 SFML 1.6,  Visual C++ 2010

 I load an image and set it as a sprite:

   MyImage.LoadFromFile("Sprite2.bmp"))

   // Create a sprite called Rocket from MyImage
   sf::Sprite Rocket(MyImage);

 This all works and the sprite appears on the screen.

 Now when I try to set the origin of the sprite:
   Rocket.setOrigin(25, 25);

 I get a compiler error saying:
 error C2039: 'setOrigin' : is not a member of 'sf::Sprite'

 What am I doing wrong here?

jerryd

20
Graphics / Sprite.setOffest causes compiler error
« on: April 23, 2013, 05:13:42 am »
SFML forum,

 SFML 1.6,  Visual C++ Express 2010

 I've searched this forum for posts on this subject but
 none of them answer my question.

 I want to relocate the x/y origin of a sprite for rotation.

 I've seen example programs that uses code like:
 Sprite.setOrigin(100, 100);

 But if I try to use this I get a compiler error that says:
 error C2039: 'setOrigin' : is not a member of 'sf::Sprite'

 This command exists in the sf::Sprite Class Reference so
 I'm confused and stuck?

jerryd

21
Graphics / LoadFromFile always fails
« on: April 20, 2013, 07:28:37 am »
SFML forum,

 SFML 1.6  Visual C++ Express 2010

 I'm new to SFML and have a very simple "open a window" program
 called FirstWindow that works.

 Now I try to load an image with this code:
   sf::Image MyImage;
   MyImage.LoadFromFile("Sprite2.bmp");

 It compiles without errors but when I run it I get this message:
 "FirstWindow has encountered an error and must close".

 If I comment out the LoadFromFile command the program runs OK.

 The file Sprite2.bmp resides in the program folder and I
 can open it and see the bmp image.

 Any suggestions?

jerryd

Pages: 1 [2]