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

Author Topic: Set Background Color Mac OS X  (Read 4863 times)

0 Members and 1 Guest are viewing this topic.

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Set Background Color Mac OS X
« on: September 08, 2010, 05:31:01 pm »
Hello, everybody. I'm trying to make the background color of my render window transparent, so I tried to use the sf::RenderWindow::SetBackgroundColor function; however, it doesn't appear that the function exists with my documentation and build of SFML (1.6), even though it's on the online reference. Is this function exclusive to a build of SFML after 1.6, or is there something I'm missing? I would appreciate some help :] Thanks in advance.

Colton
Whether you think you can or you can't, you're right.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Set Background Color Mac OS X
« Reply #1 on: September 08, 2010, 05:38:25 pm »
The "background" color is now used with the Clear function.

http://www.sfml-dev.org/documentation/1.6/classsf_1_1RenderTarget.htm#125645088d7b2df07599ea36fbb8b87e

BTW, you will not be able to have a transparent window.
SFML / OS X developer

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Set Background Color Mac OS X
« Reply #2 on: September 08, 2010, 05:49:14 pm »
I see, I see... Thank you much. Is there any possible way for me to use an alternate function or process to make a transparent window? For the game I'm conceiving of, that's essentially what really makes it worthwhile to make for me. I appreciate the help :]
Whether you think you can or you can't, you're right.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Set Background Color Mac OS X
« Reply #3 on: September 08, 2010, 06:36:13 pm »
There two ways. The first one and the easiest one is to create your own window and let SFML use it as a handle (see doc about Create function of sf::Window). This way you can do all the fancy things you want.

The second way requires you to know how SFML works from the inside and create your own version of SFML.

The sad part of both is that you have to do the stuffs for Unix, OS X and Windows, that is at least three times.

Or you can find some other library to do the stuff.
SFML / OS X developer

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Set Background Color Mac OS X
« Reply #4 on: September 08, 2010, 09:24:30 pm »
Thank you very much for your reply, Hiura :]

I'm thinking I'll have to tackle the first option, considering I don't think I have a good enough level of skill to mess with the library :p I'm just going to compile and run the program on Mac OS X for now... just to get it all working. Once I've done that and I want to cross-compile or port it, I'll consider doing the windowing for the other two. But can you please explain to me exactly what I need to do for that first option? I looked at the function for that class as you said, but I don't know what I must do to solve the problem with it. I apologize, as I don't have much experience with this library.... I've only made a couple little things with it :p

Thank you very much for your time.

Colton
Whether you think you can or you can't, you're right.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Set Background Color Mac OS X
« Reply #5 on: September 08, 2010, 10:11:25 pm »
I'm sorry, I don't remember all of the details and I don't have a valid example on my computer. =/

But I can give you some of the requirements :
Knowing ObjC basis and cocoa basis
Plus knowing how to create window (and view?) by hand (not with interface builder)

Well, as you can see it requires some training. Also, I've no idea how to get a transparent window with cocoa (and any other lib in fact).

I'm sorry to disappoint you. But if you find out I'll be very interested in some code.  :)
SFML / OS X developer

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Set Background Color Mac OS X
« Reply #6 on: September 08, 2010, 11:00:08 pm »
Ohhh I see :/ I plan on eventually learning Objective-C, but it wasn't on my short-term agenda... shoot. :p Well thanks for your help.... I suppose I can see what is required and it probably wouldn't be terribly difficult to implement a window or view with Cocoa, but I'm trying to focus on SFML and C++ :p

Laurent, if you're viewing, I think the next build should have SetBackgroundColor again O:] But I understand there are a lot of other issues to work with besides that.

Thanks for your help, Hiura. Guess I've hit a stumbling block :p I appreciate the help and time though :]
Whether you think you can or you can't, you're right.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Set Background Color Mac OS X
« Reply #7 on: September 09, 2010, 03:47:01 pm »
To make a window transparent with Cocoa :
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html

But I actually don't think OpenGL views support transparency (not tested).
Want to play movies in your SFML application? Check out sfeMovie!