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

Author Topic: SFML sprits and images  (Read 5176 times)

0 Members and 1 Guest are viewing this topic.

foodman

  • Newbie
  • *
  • Posts: 21
    • ICQ Messenger - 570393595
    • View Profile
SFML sprits and images
« on: May 28, 2010, 04:55:53 pm »
1) I am reading the tutorial of site and I am at sprits right now

But I am not able to understand what they are and what they actually do. Do they create a image which we can move here or there when certain key is pressed by events

Like when game is created the main character we move is the sprit? , Is it like that ?

And I also tried downloading demo.cpp . The thing provided at bottom but when I debug it. it runs but some console screen flashes and goes

and

2) How to add images ?


I read the tutorial about it I also downloaded the demo.cpp But when i try to debug it using F5 in visual C++ 2008 It gives me error

And is providing path necessary for the image and if necessary where to provide

3) Same thing for fonts is path necessary cause it is not debugging

These three source codes are giving me error or weird things while debugging till here everything was fine Until the Handling render Window

Please do answer

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
SFML sprits and images
« Reply #1 on: May 28, 2010, 06:33:40 pm »
Please do c++ tutos first.
As you are saying you did full c++, and this is not right, I really think you should do real c++ before trying to use SFML.

    - This is not a spirit, but a
Sprite
- If you got some errors, please quote them here in order we can help you
- What SFML version are you using (I think you are using SFML 2.0 and looking at tutos for the 1.6)
- From which country are you from ? :) (there is a forum for french people, english (here) and german too)
- You can add images with sf::Image, but you must use sf::Sprite to use them (sf::Image is just a texture for a quad)
- We are here to answer questions, no need to please us ;)
[/list]
Mindiell
----

foodman

  • Newbie
  • *
  • Posts: 21
    • ICQ Messenger - 570393595
    • View Profile
SFML sprits and images
« Reply #2 on: May 28, 2010, 07:32:08 pm »
Well I am sorry I don't know how much c++ is I am doing only c++ for a year so i thought it is  done

Well but I am doing this sfml for fun

sorry for silly spirit thing and I am not French,German or English  :oops:

I just want to make simple thing out of it before my vacation ends

And when some one answers really rudely i get frustrated


So to the main question

Sprite is not actually showing any kind of error when I try to debug it it just flashes. Nothing happens , I am talking about the file provided at the bottom of the page, I downloaded it and tried to debug it and out put was a flash

Another thing I found

Some times when I try to compile same old program like opening window or creating shapes
Which actually worked before

when i try them again

they some times give me error of graphics.dll not found or window.dll not found and most times they not run

Weird

I have linked it correctly even checked thrice.

I am using SFML 1.6 I guess it is updated version and Visual C++ compler

Can you please give me answers?

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
SFML sprits and images
« Reply #3 on: May 28, 2010, 09:40:08 pm »
Quote from: "foodman"
Can you please give me answers?
Again, We are there for this ;)

Never wanted to be rude, but your questions are... weird, at least seem weird :)

By the way, what are you linking ? You must link the sfml libs : sfml-xxxx (window, audio, graphic, etc...)
An other important thing is how do you compile debug or release ? dynamic or static ?
If dynamic, you must define SFML_DYNAMIC in options (well the tuto explain it, I suppose you've done it).

It's hard to help without any real error : a flash is strange for sure.

Last idea : ATI graphic card ? Last drivers installed ?

When you downloaded the SFML, did you tried the samples ? If not, can you try them ? Are they working well ?
Mindiell
----

foodman

  • Newbie
  • *
  • Posts: 21
    • ICQ Messenger - 570393595
    • View Profile
SFML sprits and images
« Reply #4 on: May 29, 2010, 07:21:43 am »
Answering all questions in line

U was never rude I was just trying to tell that when people are rude i get frustrated and write anything :oops:  , and i am really sorry for that

I am linking
Code: [Select]
sfml-system.lib
sfml-window.lib
sfml-graphics.lib


Even tried to add -s -d and everything and I am compiling static not dynamic
So no problem of that

About Flash
I mean when I try to debug Your sample program provided at bottom of page

The out put just blinks

U know like in C++

when we write a cout program to show something on screen and

If we dont write
cin.ignore
cin.get

How the screen blinks It doesn't hold the output window

Its something like that

One more new Problem

some times when I try to revise like opening a window program which was done my me yesterday

It gives me error of window.dll It says "Window.dll not found please re-install again and retry " something like that

and another time it works perfectly, Isn't it weird

Some times when I try rendering a widow

It gives me error of graphic.dll same error provided up

And again when i try it works  :?:

This thing is not only with me

try searching on google I found many other programming forums where people are asking about these kinds of error.

Last thing

I am not Big in knowledge as you so I have to please you dont hesitate  in it   :)

So can you please answer my questions.  :D

Walker

  • Full Member
  • ***
  • Posts: 181
    • View Profile
SFML sprits and images
« Reply #5 on: May 29, 2010, 04:03:25 pm »
As far as the DLL errors go, with most IDEs, by default, you must have the DLLs in the same directory as the project file to run the program FROM THE IDE. If you want to run an .exe directly, the DLLs must be in the same folder as the .exe

foodman

  • Newbie
  • *
  • Posts: 21
    • ICQ Messenger - 570393595
    • View Profile
SFML sprits and images
« Reply #6 on: May 29, 2010, 05:25:49 pm »
The most I can explain about this new error is by video

And this New error is not giving me to compile anykind of thing actually


http://www.screencast.com/t/M2ZlZDJiMT

Please see this video made by me

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
SFML sprits and images
« Reply #7 on: May 29, 2010, 06:59:23 pm »
The video shows exactly what Walker said. You must take the sfml dll's and put'em into your solution and/or executable directory.

foodman

  • Newbie
  • *
  • Posts: 21
    • ICQ Messenger - 570393595
    • View Profile
SFML sprits and images
« Reply #8 on: May 29, 2010, 07:04:07 pm »
But my rendering a window program was running without moving any dll . with same configuration And now the same program is also not running  :?:

Well But Now I moved the DLL as you told now the Errors are gone

Thank you for that

But now the previous error is back

The sprit window just flashes

http://www.screencast.com/t/YzZlOTM3

Watch the video I have also shown By debugging 3 times

The out put just flashes?  :?

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
SFML sprits and images
« Reply #9 on: May 29, 2010, 09:41:51 pm »
As you can see in the debugger, your app returns 0x0001, which is EXIT_FAILURE.
Looks like your image isn't loading (because it isn't in the path of the executable/solution).

You still have a lot to learn :p

foodman

  • Newbie
  • *
  • Posts: 21
    • ICQ Messenger - 570393595
    • View Profile
SFML sprits and images
« Reply #10 on: May 30, 2010, 09:28:30 am »
Quote
You still have a lot to learn :p


You are absolutely right  :oops:

But now I my sprit is working

Thank you atlast now I can move further in My tutorials

I am so happy  :D  :D

foodman

  • Newbie
  • *
  • Posts: 21
    • ICQ Messenger - 570393595
    • View Profile
SFML sprits and images
« Reply #11 on: May 30, 2010, 09:36:29 am »
Well sorry for again disturbing u people but I wanted to stay the colors same so I just removed
   
Code: [Select]
Sprite.SetColor(sf::Color(0, 255, 255, 128));

after that I rebuild all No error found

But while debugging it gave me error of

MSVCP90D.dll

It was written " this application has failed to start because MSVBP90D.dll was not found. Re-installing the application may fix this problem."

But when I put the

 
Code: [Select]
Sprite.SetColor(sf::Color(0, 255, 255, 128));

Back I got The output again

Why this MSBCP90D.dll error is coming

SORRY FOR DISTURBING U PEOPLE AGAIN AND AGAIN

but please answer this question

 :P

foodman

  • Newbie
  • *
  • Posts: 21
    • ICQ Messenger - 570393595
    • View Profile
SFML sprits and images
« Reply #12 on: May 30, 2010, 11:34:12 am »
Well I found a solution my self But I would like to know is it correct

Projects built on a software-mounted drive complain about a missing MSVCR90D.dll. The problem goes away if you turn off incremental linking (and rebuild all, of course).

(Project properties... Linker... General... Enable Incremental Linking: No).

Is it correct

 

anything