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 - chrisciscoioio

Pages: [1] 2
1
Window / Re: Mouse Get Position Issue
« on: October 31, 2012, 03:11:50 pm »
I wasn't passing a window to be relative to, I assumed that passing a window was only used for multiple window setup, apparently it is not, my issue is resolved.

2
Window / Mouse Get Position Issue
« on: October 31, 2012, 02:55:43 pm »
I wasn't passing a window to be relative to, I assumed that passing a window was only used for multiple window setup, apparently it is not, my issue is resolved.

3
System / Re: sf::err result what does it mean?
« on: October 28, 2012, 05:13:50 pm »
heh, ya that's right, stupid mistake

4
System / Re: sf::err result what does it mean?
« on: October 28, 2012, 02:53:17 pm »
Follow up question, so it works, but only in certain cases in my code, if I wrap it in an if statement at all, it wont output to the file...

See the output, if I remove the if statement it will output to the file, if I leave it in all it will do is not print to the console but not output to the file.

// Enable Logging if in Debug Mode
        if(_DEBUG)
        {
                // Base Name, Enabled, Has Date
                Logger::Init("Soaring Steele",true,true);
        }
        else
        {
                // Base Name, Enabled, Has Date
                Logger::Init("Soaring Steele",false,true);
        }

        // Redirect the standard error to a file, if logging is enabled.
        // For some reason you cannt wrap an if statement around this or it fails to work right.
        // So comment out if you dont want the standard error going here.
        if(Logger::isEnabled)
       {
        std::ofstream file(Logger::logFile.c_str(), std::ios::app);
        std::streambuf* previous = sf::err().rdbuf(file.rdbuf());
        }

5
System / Re: sf::err result what does it mean?
« on: October 28, 2012, 02:29:53 pm »
What exactly are you trying to do?  Writing a stream to another stream doesn't make much sense.

Are you trying to redirect sf::err to another stream?  That's covered in the documentation.

http://www.sfml-dev.org/documentation/2.0/group__system.php

Which crashes.... following the documentation code for code .

Edit: Or not? apparently setting it in the main doesnt crash it, but setting it in my Logger init does... o well, literally copy and paste between the two.

6
System / Re: sf::err result what does it mean?
« on: October 28, 2012, 03:32:13 am »
sf::err is a ostream, I dont know how else to get the SFML error message.

That is a write function I only made to try and write out the sf::err, my normal one only takes string.

7
System / Re: sf::err result what does it mean?
« on: October 28, 2012, 02:42:27 am »
Where am I doing that?

maybe you caught a look at the code before I changed the code to what it should be.

Anyways how can I fix it so that I can output the stream after a string like in the code sample.

I tried following the redirect in the documentation but that causes the program to crash with a
Unhandled exception at 0x774a15de in Soaring Steele Prototype.exe: 0xC0000005: Access violation.

8
System / Re: sf::err result what does it mean?
« on: October 28, 2012, 02:34:00 am »
Output sf::err to a file like so.

static void Write(std::string message,std::ostream& stream)
        {
                if(isEnabled)
                {
                        std::fstream file;
                        file.open(logFile.c_str(), std::ios::out | std::ios::app);

                        if (file.is_open())
                        {
                                file << message;
                                file << stream;
                                file << "\n";
                                file.close();
                        }
               
                }
        }


This particular error comes from not being able to load an image, I know why it cannot load the image, so I am not trying to solve that issue, I am just trying to get my Logger working with sf::err like above.

9
System / sf::err result what does it mean?
« on: October 28, 2012, 02:11:03 am »
this is the output of an sf::err - 6B63D240 

It looks like a memory address, is it not a useful string, I am missing something?                       

10
That doesn't actually work but I played with a variety of systems, and I found one that solves this, baring any camera movement which I would have to adjust by.

But if I take the screenHeight and minus the pos.y it will work.

11
Drawing is fine, this is an issue I am having integrating SFML with OpenGL to get world coords.

What I don't have is converting the sf::mouse position to world coords. Everything else already works as long as I can get the correct coords.

Right now on my screen, the x works fine, because I am not moving the camera, but the y value is off, if I am above the mid line of the screen it is below it, and if I am below the mid line it is above it.

12
I am not using sf::Sprite.

I think that is the issue, I am just not sure how to fix it, sf::Sprite is not an option.

13
If I click on the black dot it creates a point at the green dot.

I guess this is because I am rendering in OpenGL, and just using SFML for windows and input.

How can I transform the one set of coords into the other?

14
Window / sf::Mouse::getPosition(*window) is returning the wrong location.
« on: September 29, 2012, 08:19:44 pm »
I am going to start this off with I am sure I am missing something, but I am not sure what.

sf::Vector2i pos = sf::Mouse::getPosition(*window); doesnt seem to be returning the correct y value, the x value appears right however, I have attached an image that shows where my mouse is when clicked compared with where the point appears.

[attachment deleted by admin]

15
No I have everything stored at the project level for portability.

Pages: [1] 2