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

Author Topic: SFML Window not showing!!!  (Read 35868 times)

0 Members and 2 Guests are viewing this topic.

Serapth

  • Full Member
  • ***
  • Posts: 105
    • View Profile
SFML Window not showing!!!
« Reply #90 on: January 02, 2012, 10:09:54 pm »
Quote from: "Viruses"
Lol ive been through more than 73 tutorials, a book, and other websites and you saying i have to learn the basics.. This is probably one of those things that werent taught so.. and this has to do with sfml. the sf::RenderWindow() parameters..



No, it really doesn't.  If you managed to read that many tutorials and they never covered defining functions, let alone classes, you really need to pick different tutorials.


void Display(sf::RenderWindow(sf::VideoMode(int,int,int), string);


That line for example is proof positive that you don't really understand the syntax of defining a member function.  You are combining aspects of a function declaration, implementation and call all in one.  I can't even decipher back to what you were even trying to do.

Coincidentally, if you want to pass a RenderWindow into a method Display you would define it in the .h as:


void Display(sf::RenderWindow&)

Then in the .cpp file, you would declare it as:

void Player::Display(sf::RenderWindow & renderWindow)
{
}

Note the lack of semi colon.  Another mistake in your example ( the semi colon at the end of the implementation ) is telling you need to work a bit more on the basics.  

But hey, whatever, good luck.

Viruses

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
SFML Window not showing!!!
« Reply #91 on: January 02, 2012, 11:34:26 pm »
Umm i was just about to reply that i searched it up and i actually found that you gotta pass the address. But since i dont get why you cant just do this:

void Display(sf::RenderWindow) in the header file I guess i have to do the basics..

Tex Killer

  • Full Member
  • ***
  • Posts: 242
    • View Profile
SFML Window not showing!!!
« Reply #92 on: January 03, 2012, 12:54:55 am »
Viruses, that way your RenderWindow would be copied every time the function is called, and that is not good.

Vastrolorde

  • Newbie
  • *
  • Posts: 1
    • View Profile
SFML Window not showing!!!
« Reply #93 on: January 03, 2012, 07:12:25 pm »
HAving the same problem, i get this console screen that freeses. I  have ATI video card and SFLM 1.6, and i use Code::Blocks. that .dll what was suggested here didnt work for me and SFLM2 i cant fnd, the snapshot of SFLM didnt work for me.

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
SFML Window not showing!!!
« Reply #94 on: January 04, 2012, 02:47:11 am »
Quote from: "Vastrolorde"
HAving the same problem, i get this console screen that freeses. I  have ATI video card and SFLM 1.6, and i use Code::Blocks. that .dll what was suggested here didnt work for me and SFLM2 i cant fnd, the snapshot of SFLM didnt work for me.
What's SFLM? This is a forum for SFML. ;)

You're experiencing the infamous ATi bug. Wait for SFML2 to be released, or try the static libraries for SFML 1.6.
I use the latest build of SFML2

Viruses

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
SFML Window not showing!!!
« Reply #95 on: January 05, 2012, 04:22:05 pm »
Yoo dude i had the same problem i got the SFML 2.0 snapshot and built it with Cmake. If you dont know what im talking bout,just search it up on youtube or google. It worked perfectly for me!

 

anything