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.


Messages - Williamson

Pages: [1] 2
1
Graphics / How to texture a sphere?
« on: July 03, 2009, 12:50:13 pm »
I may have found a solution: does anyone know of an example of the Bind() function of the Image class, used in conjunction with a gluSphere.
Thanks!
Williamson

2
Graphics / How to texture a sphere?
« on: July 02, 2009, 11:34:03 am »
Hi
For a game I am making, I need to draw a sphere, representing a planet.
However, I cannot work out how do texture a sphere create dwith this code, by using a sf::Image
Code: [Select]
gluSphere(params,25,20,20);
Thanks for any help that can be offered :)
Williamson

3
Graphics / Getting absolute coordinates
« on: December 07, 2008, 01:47:36 pm »
I found what was wrong!
It was a REALLY stupid mistake!
I put :

sf::Vector2f MousePosAbsolute = displayWindow.ConvertCoords(displayWindow.GetInput().GetMouseX(), displayWindow.GetInput().GetMouseY());
                           
Instead of :

sf::Vector2f MousePosAbsolute = displayWindow.ConvertCoords(displayWindow.GetInput().GetMouseX(), displayWindow.GetInput().GetMouseY(), &view);

It does exactly what I want now  :)

Thanks to all for your help and patience

Williamson

4
Graphics / Getting absolute coordinates
« on: December 07, 2008, 11:54:21 am »
Well...
This cant be good...
I recompiled, the same code as before, and got the same result.
The convertCoordinates function doesnt appear to do anything:

Type 1:5:5
Type 2:5:5
Type 1:11:3
Type 2:11:3
Type 1:10:6
Type 2:10:6
Type 1:6:4
Type 2:6:4
Type 1:5:6
Type 2:5:6
Type 1:9:4
Type 2:9:4
Type 1:7:2
Type 2:7:2
Type 1:7:5
Type 2:7:5
Type 1:13:5
Type 2:13:5
Type 1:12:2
Type 2:12:2
Type 1:11:2
Type 2:11:2
Type 1:10:5
Type 2:10:5
Type 1:14:6
Type 2:14:6

Is this an error caused by me?
Williamson

5
Graphics / Getting absolute coordinates
« on: December 07, 2008, 11:46:03 am »
Thanks everyone!
It works great now
Williamson

6
Graphics / Getting absolute coordinates
« on: December 07, 2008, 10:54:32 am »
Thanks, but I guess thi s just isnt my week!  :(

In file included from SoundFile.cpp:29:
../../SFML/Audio/SoundFileDefault.hpp:32:21: error: sndfile.h: No such file or directory
In file included from SoundFile.cpp:29:
../../SFML/Audio/SoundFileDefault.hpp:128: error: ‘sf_count_t’ does not name a type
../../SFML/Audio/SoundFileDefault.hpp:129: error: ‘sf_count_t’ does not name a type
../../SFML/Audio/SoundFileDefault.hpp:130: error: ‘sf_count_t’ does not name a type
../../SFML/Audio/SoundFileDefault.hpp:131: error: ‘sf_count_t’ does not name a type
../../SFML/Audio/SoundFileDefault.hpp:132: error: ‘sf_count_t’ does not name a type
../../SFML/Audio/SoundFileDefault.hpp:141: error: ‘sf_count_t’ does not name a type
../../SFML/Audio/SoundFileDefault.hpp:147: error: ISO C++ forbids declaration of ‘SNDFILE’ with no type
../../SFML/Audio/SoundFileDefault.hpp:147: error: expected ‘;’ before ‘*’ token
make[2]: *** [SoundFile.o] Error 1
make[2]: Leaving directory `/home/thomas/Desktop/SFMLSVNcheckout/src/SFML/Audio'
make[1]: *** [sfml-audio] Error 2
make[1]: Leaving directory `/home/thomas/Desktop/SFMLSVNcheckout/src/SFML'
make: *** [sfml] Error 2

I'll try redownloading it, to see if that make a difference
Williamson

[EDIT: Nope, still same problem]

7
Graphics / Getting absolute coordinates
« on: December 06, 2008, 10:23:23 pm »
Thanks, hadnt seen that.
But I am using linux(gcc), and when I do make install, it tells me the libs are missing.
I tried using the old ones, but no cigar.
Should the .so s be on the SVN?
Thanks for the help so far!
Williamson

8
Graphics / Getting absolute coordinates
« on: December 06, 2008, 10:09:31 pm »
Thanks!
Ok.
Errrrrr
This may sound like a stupid question, but...
How?  :oops:
Williamson

9
Graphics / Getting absolute coordinates
« on: December 06, 2008, 08:01:51 pm »
Well, as far as I could tell, I only had to copy the new include file to the correct directory. I recompiled, and.... :

InterfaceGraphique.cpp:(.text+0x18b5): undefined reference to `sf::Unicode::Text::Text(char const*)'
InterfaceGraphique.cpp:(.text+0x18d3): undefined reference to `sf::String::String(sf::Unicode::Text const&, sf::Font const&, float)'
InterfaceGraphique.cpp:(.text+0x1901): undefined reference to `sf::Unicode::Text::Text(char const*)'
InterfaceGraphique.cpp:(.text+0x191f): undefined reference to `sf::String::String(sf::Unicode::Text const&, sf::Font const&, float)'
InterfaceGraphique.cpp:(.text+0x1b4b): undefined reference to `sf::Unicode::Text::Text(char const*)'
InterfaceGraphique.cpp:(.text+0x1b5d): undefined reference to `sf::String::SetText(sf::Unicode::Text const&)'
InterfaceGraphique.cpp:(.text+0x1bde): undefined reference to `sf::Unicode::Text::Text(char const*)'
InterfaceGraphique.cpp:(.text+0x1bf0): undefined reference to `sf::String::SetText(sf::Unicode::Text const&)'
InterfaceGraphique.cpp:(.text+0x1cde): undefined reference to `sf::RenderTarget::Draw(sf::Drawable const&)'
InterfaceGraphique.cpp:(.text+0x1cf0): undefined reference to `sf::RenderTarget::Draw(sf::Drawable const&)'
InterfaceGraphique.cpp:(.text+0x1d02): undefined reference to `sf::RenderTarget::Draw(sf::Drawable const&)'
InterfaceGraphique.cpp:(.text+0x1d14): undefined reference to `sf::RenderTarget::Draw(sf::Drawable const&)'
InterfaceGraphique.cpp:(.text+0x1f25): undefined reference to `sf::Unicode::Text::Text(char const*)'
InterfaceGraphique.cpp:(.text+0x1f37): undefined reference to `sf::String::SetText(sf::Unicode::Text const&)'
InterfaceGraphique.cpp:(.text+0x1fb4): undefined reference to `sf::Unicode::Text::Text(char const*)'
InterfaceGraphique.cpp:(.text+0x1fc6): undefined reference to `sf::String::SetText(sf::Unicode::Text const&)'
InterfaceGraphique.o: In function `InterfaceGraphique::InterfaceGraphique()':
InterfaceGraphique.cpp:(.text+0x3897): undefined reference to `sf::Font::ourDefaultCharset'
InterfaceGraphique.cpp:(.text+0x389f): undefined reference to `sf::Unicode::Text::Text(unsigned int const*)'
InterfaceGraphique.cpp:(.text+0x38da): undefined reference to `sf::Font::LoadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, sf::Unicode::Text const&)'
InterfaceGraphique.o: In function `InterfaceGraphique::InterfaceGraphique()':
InterfaceGraphique.cpp:(.text+0x5cef): undefined reference to `sf::Font::ourDefaultCharset'
InterfaceGraphique.cpp:(.text+0x5cf7): undefined reference to `sf::Unicode::Text::Text(unsigned int const*)'
InterfaceGraphique.cpp:(.text+0x5d32): undefined reference to `sf::Font::LoadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, sf::Unicode::Text const&)'
collect2: ld returned 1 exit status



 :shock:  ARGH!
Did I forget a step, cos this code worked fine before.
Williamson

10
Graphics / Getting absolute coordinates
« on: December 06, 2008, 05:40:59 pm »
In any case, I'm sure that there is a bug. With this code:
Code: [Select]
sf::Vector2f MousePosAbsolute = displayWindow.ConvertCoords(displayWindow.GetInput().GetMouseX(), displayWindow.GetInput().GetMouseY());
                            sf::Vector2f MousePosB;
                            MousePosB.x = displayWindow.GetInput().GetMouseX();
                            MousePosB.y = displayWindow.GetInput().GetMouseY();
                            std::cout << "Type 1:" << ((int)MousePosB.x - (int)MousePosB.x%64)/64 << ":" << ((int)MousePosB.y - (int)MousePosB.y%64)/64 << std::endl;
                            std::cout << "Type 2:" << ((int)MousePosAbsolute.x - (int)MousePosAbsolute.x%64)/64 << ":" << ((int)MousePosAbsolute.y - (int)MousePosAbsolute.y%64)/64 << std::endl;


I get this (and I do move the view around):

Type 1:0:0
Type 2:0:0
Type 1:1:0
Type 2:1:0
Type 1:2:0
Type 2:2:0
Type 1:3:0
Type 2:3:0
Type 1:4:0
Type 2:4:0
Type 1:0:0
Type 2:0:0
Type 1:1:0
Type 2:1:0
Type 1:2:0
Type 2:2:0
Type 1:3:0
Type 2:3:0
Type 1:4:0
Type 2:4:0

I'm gonna try installing the SVN version now.

Williamson

11
Graphics / Getting absolute coordinates
« on: December 05, 2008, 09:31:56 pm »
Its really weird: no matter which I try, I get the same result: the coordinates that I clicked from the views point of view, rather than those of the world.
I am SURE that shouldnt be happening  :shock:
Should I try the SVN version?
Williamson

12
Graphics / Getting absolute coordinates
« on: December 03, 2008, 10:03:46 pm »
I thought that THAT was used to get the position relative to the view.
Williamson

13
Graphics / Getting absolute coordinates
« on: December 03, 2008, 09:10:08 pm »
Thanks!
So there isnt one in the current, stable 1.3 version of SFML?
Williamson

14
Graphics / Getting absolute coordinates
« on: December 03, 2008, 07:09:11 pm »
Hi everyone!
Thanks to Wizzard, I managed to make a fair amount of progress, but I have hit another snag: I need to get the absolute coordinates of a point when it is clicked (so, not relative to the sf::View, but to the world itself). I tried
Code: [Select]
sf::Vector2f MousePosAbsolute;
                            MousePosAbsolute.x = displayWindow.GetInput().GetMouseX();
                            MousePosAbsolute.y = displayWindow.GetInput().GetMouseY();

But it didnt seem to work.
Have I done something wrong? Or am I barking up the wrong tree?
Thanks!
Williamson

15
Graphics / Displaying a Sprite on a View
« on: December 01, 2008, 07:32:51 pm »
Thanks!
Ill give it a try as soon as possible
Williamson

[EDIT:] Thanks Wizzard! It does exactly what I wanted now!

Pages: [1] 2