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

Pages: 1 ... 7 8 [9] 10
121
         Well I've had this every time I have tried to make a program, finally I felt like actually having debuging might be a useful tool. So the problem is this, when Visual Studio launches a program, either in debug or release, it will not find any of it's resources, and thusly, not work. However, I CAN go to the debug/release folder, run it manually, and it works perfectly. It just won't work when Visual Studio launches it.

           I decided to post this question here because this community has been a big help so far. ^_^ I don't believe it to be a specific issue with SFML. It looks more like some screwy setting in Visual Studio, but upon googling the issue, I found NOTHING of other people having this issue. I guess that means either 1, its a simple fix that everyone knows, or 2. I'm just that unlucky of a person. So I'm looking foreward to your input! :D

...woundering if I should try to find a microsoft forum to ask this same thing...

122
SFML wiki / Re: sfeMovie project [v1.0 RC1 available]
« on: July 13, 2012, 07:18:30 pm »
...not sure where to go from here.
I think you do :P :
If it still doesn't work, can you give me a sample of the video in order to reproduce the issue ?

Well I had the same issue with the sample video, which was named "big_buck_bunny_480p_stereo.ogg"

It's too big to upload here, but I downloeded it from your example you posted.

Both, my video, and your video, did the same thing. I'm not sure if its the video anymore. :|

Just the same though, I'll send a PM with a link to a location to download the videos from my website.

123
SFML wiki / Re: sfeMovie project [v1.0 RC1 available]
« on: July 13, 2012, 02:51:58 pm »
Just to make sure, did you try to play your video with the provided sfeMovie sample (sample/main.cpp in the Git repo or the "src" package) ? Just change the name of the file to load.

If it still doesn't work, can you give me a sample of the video in order to reproduce the issue ?

I just did, the example video did the same thing. :/ ...not sure where to go from here.

Fortunettely for now, I can continue working on the engine since you can skip the video by pressing any button ;) Though, I still have to figure out whats wrong, at this point, I havn't a clue.

124
SFML wiki / Re: sfeMovie project [v1.0 RC1 available]
« on: July 13, 2012, 02:03:01 am »

So I seem to still get audio, but no video. All that happens video wise, is I originally, right after my WindowEngine launches the render window. I print a "Loading..." to the upper left corner. Something video wise happens because it does flicker a lot. But nothing new renders to the screen at all. I only get 1 unknown skeleton version 4.0 error. I think that may have to do with why there is no video.

I will include a copy of my most up to date code.
#include "stdafx.h"
#include "SplashScreen.h"
#include "WindowEngine.h"
#include <Movie.h>

void SplashScreen::showSplash(sf::RenderWindow& renderWindow)
{
        PredawnStudiosGenesisSplash(renderWindow);
}
void SplashScreen::PredawnStudiosGenesisSplash(sf::RenderWindow& renderWindow)
{
        sfe::Movie PredawnSplash;
        if(!PredawnSplash.openFromFile("Recource/SplashScreen/PredawnStudios/predawn_splash.ogv"))
        {
                return;
        }

        sf::Vector2u WindowSize = renderWindow.getSize();
        sf::Vector2i PredawnSplashSize = PredawnSplash.getSize();

    int PositionX = (WindowSize.x / 4);
    int PositionY = (WindowSize.y / 4);

        int SplashX = PredawnSplashSize.x;
        int SplashY = PredawnSplashSize.y;

        int CenterX = (PredawnSplashSize.x / 2);
        int CenterY = (PredawnSplashSize.y / 2);

        PredawnSplash.setOrigin(CenterX,CenterY);

        if(SplashX > WindowSize.x)
                SplashX = WindowSize.x;
           
        if(SplashY > WindowSize.y)
                SplashY = WindowSize.y;

        PredawnSplash.resizeToFrame(PositionX,PositionY,SplashX,SplashY);
        PredawnSplash.play();
        while(PredawnSplash.getStatus() == sfe::Movie::Status::Playing)
        {
                sf::Event PredawnSplashEvent;
                while(renderWindow.pollEvent(PredawnSplashEvent))
                {
                        if(PredawnSplashEvent.type == sf::Event::Closed)
                        {
                                PredawnSplash.stop();
                        }
                        if(PredawnSplashEvent.type == sf::Event::MouseButtonPressed)
                        {
                                PredawnSplash.stop();
                        }
                        if(PredawnSplashEvent.type == sf::Event::KeyPressed)
                        {
                                PredawnSplash.stop();
                        }
                }
                renderWindow.clear();
                renderWindow.draw(PredawnSplash);
                renderWindow.display();
        }
        return;
}
 

I think I'm going to do some snooping on my video codec's. Do let me know if you have any ideas. :)

Also, kind of off the subject, but do you know how to make it so visual studio can find files and resources while debugging? It doesn't find my video file in debugging mode, yet if I go to the directory and run it manually, it works just fine. Just a little annoying because it makes debugging impossible. Anyway. Let me know what you think.

Also, the video does play perfectly in VLC. So I at least know that it does have a video track. xD

Also, again, if you want a copy of the video for testing let me know. :)

EDIT

found this, I plan to read it, all.
http://roundup.libav.org/issue2600

EDIT Just tried a different encoder, same issue. >_> Though, now it seems I no longer get the skeleton error. So.... Thats fixed, but its still not working. xD

125
SFML wiki / Re: sfeMovie project [v1.0 RC1 available]
« on: July 13, 2012, 01:34:24 am »
if(PredawnSplashEvent.type = sf::Event::Closed)
should be
if(PredawnSplashEvent.type == sf::Event::Closed)

Same for the other tests.

And I'm not sure what you want to do with
int PositionX = (WindowSize.x / 4);
    int PositionY = (WindowSize.y / 4);

        int SplashX = PredawnSplashSize.x;
        int SplashY = PredawnSplashSize.y;

        int CenterX = (PredawnSplashSize.x / 2);
        int CenterY = (PredawnSplashSize.y / 2);

        PredawnSplash.setOrigin(CenterX,CenterY);
        PredawnSplash.setPosition(PositionX,PositionY);

        if(SplashX > WindowSize.x)
                SplashX = WindowSize.x;
           
        if(SplashY > WindowSize.y)
                SplashY = WindowSize.y;
 
but the movie's position and scaling are overwritten by
PredawnSplash.resizeToFrame(0,0,SplashX,SplashY);
thus your setPosition() seems useless.

Edit : And PredawnSplash.Playing is a enum value, thus testing your while loop against it has no meaning. You probably wanted to write "while (PredawnSplash.getStatus() == sfe::Movie::Playing)".

Oh wow. >_< I always switch around the = and the == symboles.

As for the large chunk of code. I was just checking the windows size and compairing it to that of the default size of the video. If the window is too small for the default video size, it scales the video to the right window size before playing it.

Thanks for the info on the enum. You were correct with what I wanted. :)

I was not aware that "PredawnSplash.resizeToFrame(0,0,SplashX,SplashY);" would overwrite that but now that I know I will update it to include the proper position. Though, I was woundering what those to 0's were about.  ::)

Have a nice day, and thanks a bunch for the help! I look foreward to hooking this up and testing. :D

126
SFML wiki / Re: sfeMovie project [v1.0 RC1 available]
« on: July 13, 2012, 12:30:26 am »
Also I was able to get the video playing, well not playing. But the screen flickers a lot, and the audio chops in/out/repeats. I looked and I get about 1 Unknown Skeleton v4.0 error every second. Did my encoding go bad on my video?

I should also point out. I noticed it only plays the sounds when I'm NOT on the render window, and it only displayes the skeleton errors as I move the mouse over the render window. o.O'' Could this just be a huge bug in my programming? Because it seems like it could be a huge bug in my programming...... :|
If you use the FFmpeg binaries provided within the sfeMove 1.0 RC1 package, note that they only include some decoders : vorbis, theora and flac. Thus if your video uses another codec it won't work until you rebuild sfeMovie and choose to enable more (non-free) decoders.

If you use one of the free decoders for your video and don't mix debug/release binaries, then I'll need to have a closer look at it and fix it.

The video itself is a .ogv Originally it was a .avi that I converted with "ffmpeg2theora-0.29"

I could try rendering it from the video editor as a stright .ogg and see if that helps. I still say something may be going fuzzy with the way I did things. I'm not even sure if half of this code was even neccesary. I was just trying to be safe xD "that goes for the way I checked the window/video size and so on"

Anyway here is the source code for what I'm doing:
SplashScreen.cpp
#include "stdafx.h"
#include "SplashScreen.h"
#include "WindowEngine.h"
#include <Movie.h>

void SplashScreen::showSplash(sf::RenderWindow& renderWindow)
{
        PredawnStudiosGenesisSplash(renderWindow);
}
void SplashScreen::PredawnStudiosGenesisSplash(sf::RenderWindow& renderWindow)
{
        sfe::Movie PredawnSplash;
        if(!PredawnSplash.openFromFile("Recource/SplashScreen/PredawnStudios/predawn_splash.ogv"))
        {
                return;
        }

        sf::Vector2u WindowSize = renderWindow.getSize();
        sf::Vector2i PredawnSplashSize = PredawnSplash.getSize();

    int PositionX = (WindowSize.x / 4);
    int PositionY = (WindowSize.y / 4);

        int SplashX = PredawnSplashSize.x;
        int SplashY = PredawnSplashSize.y;

        int CenterX = (PredawnSplashSize.x / 2);
        int CenterY = (PredawnSplashSize.y / 2);

        PredawnSplash.setOrigin(CenterX,CenterY);
        PredawnSplash.setPosition(PositionX,PositionY);

        if(SplashX > WindowSize.x)
                SplashX = WindowSize.x;
           
        if(SplashY > WindowSize.y)
                SplashY = WindowSize.y;

        PredawnSplash.resizeToFrame(0,0,SplashX,SplashY);
        PredawnSplash.play();

        while(PredawnSplash.Playing)
        {
                sf::Event PredawnSplashEvent;
                while(renderWindow.pollEvent(PredawnSplashEvent))
                {
                        if(PredawnSplashEvent.type = sf::Event::Closed)
                        {
                                PredawnSplash.stop();
                        }
                        if(PredawnSplashEvent.type = sf::Event::MouseButtonPressed)
                        {
                                PredawnSplash.stop();
                        }
                        if(PredawnSplashEvent.type = sf::Event::KeyPressed)
                        {
                                PredawnSplash.stop();
                        }
                }
                renderWindow.clear();
                renderWindow.draw(PredawnSplash);
                renderWindow.display();
        }
        return;
}
 

Let me know what I did wrong, or what I shouldn't have done and so on. I still think somethings going wrong with that loop I just can't lay a finger on it. Perhaps when a more expirienced eye such as yourself see's it. You may be able to give some recomendations. I too will be trying to figure this out. xD

Well off to dinner for now. Be back in about an hour. :)

127
SFML wiki / Re: sfeMovie project [v1.0 RC1 available]
« on: July 13, 2012, 12:23:37 am »
For now building sfeMovie really isn't as easy as SFML, especially because it uses FFmpeg that can't be built within Visual Studio. You can try to follow the wiki instructions though (without forgetting to set the Debug mode in Visual Studio).

But as another user had had the same issue, I'd made a debug build : sfeMovie-msvc-debug.zip (34KB). You can try this although it doesn't benefit from the latest bug fixes (it's from May 15th).

Well it is just for debugging after all. :)

As for the problems I'm expiriencing, I think they have to do with my events in the loop that I'm rendering the video from. It seems when a even't is poll'd it stops the audio stream, then when the event stops, it restarts it. I also see no video. >_> hmnnn Time to delete things until something works.

128
SFML wiki / Re: sfeMovie project [v1.0 RC1 available]
« on: July 12, 2012, 11:57:04 pm »
Hello Flash619,

Are you mixing debug and release binaries ? The provided sfeMovie binaries are release only.
Hi Ceylo!

Yep! xD Thats exactly what I'm doing. haha. Is there a way to build any debug binaries? Is it just like building the SFML binaries? Because if so it should be easy.... I think... *doesn't build binaries very often*

Also I was able to get the video playing, well not playing. But the screen flickers a lot, and the audio chops in/out/repeats. I looked and I get about 1 Unknown Skeleton v4.0 error every second. Did my encoding go bad on my video?

I should also point out. I noticed it only plays the sounds when I'm NOT on the render window, and it only displayes the skeleton errors as I move the mouse over the render window. o.O'' Could this just be a huge bug in my programming? Because it seems like it could be a huge bug in my programming...... :|

129
SFML wiki / Re: sfeMovie project [v1.0 RC1 available]
« on: July 12, 2012, 11:48:10 pm »
Hey not sure were to post this, but I seem to get a
Quote
Unhandled exception at 0x77e715de (ntdll.dll) in Genesis.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0075e5b0..
The moment it reaches this line in the stack trace:
if(!PredawnSplash.openFromFile("Recource/SplashScreen/PredawnStudios/predawn_splash.avi"))
 

The whole chunk of code:
void SplashScreen::PredawnStudiosGenesisSplash(sf::RenderWindow& renderWindow)
{
        sfe::Movie PredawnSplash;

        if(!PredawnSplash.openFromFile("Recource/SplashScreen/PredawnStudios/predawn_splash.avi"))
                return;
 

And lastly, the line in the call stack.
Quote
>   Genesis.exe!SplashScreen::PredawnStudiosGenesisSplash(sf::RenderWindow & renderWindow)  Line 14 + 0x29 bytes   C++

I followed the tutorial on your github.  ;D Any ideas on what I did wrong? I see that a lot of other people got this to work, so I doubt its anything to do with sfeMovie. I was just wondering if you had come across this before, and if so, what went wrong, and or, how to fix it. xD

130
http://www.lmgtfy.com/?q=c+plus+plus+by+reference ::)
If you don't understand a mechnisem don't just try blindly something but go to a source that can teach you something, only then will you be able to understand what we're trying to explain here and won't make the same mistake anymore.

So as I stated in the beginning, the WindowEngine owns the render window, thus we're only returning a reference to the object, but now in your main.cpp you're trying to copy the object at the referred location again.  What you want is to again use a reference.
        WindowEngine windowEngine;
        sf::RenderWindow& mainWindow = windowEngine.LaunchEngineWindow();

Additionally your GetScreenResoltuion function isn't needed at all (so you won't need to code platform depended code). You can simply use sf::VideoMode::getDesktopMode().

So you mean, SFML has a build in function for finding screen resolutions? o_O'

Also, about your google, xD I was following a simple sutorial here.
http://www.functionx.com/cpp/examples/returnreference.htm

Turned out I couldn't get it to work with what I was doing, I'll move onto another one I guess and try it from there. I know whats wrong in the main, but I don't know how to fix it XD I mean, I'm not sure how to jsut go to a class, and get a reference from it without somehow using a "=" so like I said, I'll probably have to spend the next few hours on google. <sarcasm> But still. A lot of google stuff I've found is passing things through methods by reference, or I find reference tutorials that say something like "int myawesomeint = Myclass.GetThatInt();" which looks like its making a copy of it, and not getting a reference.
 
EDIT, again.

So I think I found some nice walkthroughs and tutorials, and got it to work! I deffinetely will have to work with references some more to get them etched clearly into my memory. Thank you all for the awesome help! :D

Many thanks!

~Flash619

131
in this line
 sf::RenderWindow ApplyResolutionChanges(int&Height,int&Width);
you are trying to return a copy, and render window is not copyable, return reference

I changed that.

My code, as of this moment is:
Window Engine.hpp
#ifndef WINDOWENGINE_H
#define WINDOWENGINE_H
class WindowEngine
{
        sf::RenderWindow mWindow;
public:
        sf::RenderWindow& LaunchEngineWindow();
        sf::RenderWindow& ApplyResolutionChanges(int&Height,int&Width);
private:
        void GetScreenResolution(int&Height,int&Width);
};
#endif
 

Window Engine.cpp

#include "stdafx.h"
#include "WindowEngine.h"
#include <WTypes.h>
sf::RenderWindow& WindowEngine::LaunchEngineWindow(void)
{
        int Height = 0;
        int Width = 0;

        GetScreenResolution(Height,Width);

        mWindow.create(sf::VideoMode(Width,Height,32),"Genesis",sf::Style::Fullscreen);

        mWindow.setMouseCursorVisible(false);
        mWindow.setVerticalSyncEnabled(true);

        return mWindow;
}
sf::RenderWindow& WindowEngine::ApplyResolutionChanges(int&Height,int&Width)
{

}
void WindowEngine::GetScreenResolution(int&Height,int&Width)
{
        RECT desktop;
        const HWND hDesktop = GetDesktopWindow();
        GetWindowRect(hDesktop, &desktop);
    Width = desktop.right;
    Height = desktop.bottom;
}
 

The code being called in the main.cpp

        WindowEngine windowEngine;
        sf::RenderWindow mainWindow = windowEngine.LaunchEngineWindow();
 

Hope that helps ;) Le tme know what you think/find! :D *brb making lunch

132
constructor error is because of
sf::RenderWindow & mWindow;
just type
sf::RenderWindow mWindow;

And that brought me back to this again:
Quote
1>c:\sfml-2.0-rc\include\sfml\window\window.hpp(476): error C2248: 'sf::NonCopyable::NonCopyable' : cannot access private member declared in class 'sf::NonCopyable'
1>          c:\sfml-2.0-rc\include\sfml\system\noncopyable.hpp(67) : see declaration of 'sf::NonCopyable::NonCopyable'
1>          c:\sfml-2.0-rc\include\sfml\system\noncopyable.hpp(42) : see declaration of 'sf::NonCopyable'
1>          This diagnostic occurred in the compiler generated function 'sf::Window::Window(const sf::Window &)'
1>c:\sfml-2.0-rc\include\sfml\graphics\rendertarget.hpp(369): error C2248: 'sf::NonCopyable::NonCopyable' : cannot access private member declared in class 'sf::NonCopyable'
1>          c:\sfml-2.0-rc\include\sfml\system\noncopyable.hpp(67) : see declaration of 'sf::NonCopyable::NonCopyable'
1>          c:\sfml-2.0-rc\include\sfml\system\noncopyable.hpp(42) : see declaration of 'sf::NonCopyable'
1>          This diagnostic occurred in the compiler generated function 'sf::RenderTarget::RenderTarget(const sf::RenderTarget &)'

>_<

Any ideas? xD I don't have any ideas at this point that I havn't already tried.

133
#ifndef WINDOWENGINE_H
#define WINDOWENGINE_H
class WindowEngine
{
        sf::RenderWindow mWindow;
public:
        sf::RenderWindow& LaunchEngineWindow();
        sf::RenderWindow& ApplyResolutionChanges(int Height, int Width);
private:
        void GetScreenResolution(int Height, int Width);
};
#endif
....

sf::RenderWindow & WindowEngine::ApplyResolutionChanges(int Height, int Width)
{
//Something will be here soon enough.
}
 

Hmnnn?

If your trying to point at it not returning anything, I know that will throw an error. xD I'm just focusing on one error at a time. Without opening a renderWindow, I can't really change it. xD

Also at the moment, I'm trying to find a way of throwing in a constructor so it quiets down about that. Honestly, at the risk of sounding like a complete noob, I have no idea why it even requires one, I mean, it looks like it would work the way it is. I remember constructors in java..... good times.

134
You have to ask yourself: Which class should be the owner of the render window?
There can't be two windows thus it's logical that you can't copy them around.
Now if your WindowEngine is the owner of the render window, then you just have to declare it as member variable and return it as reference.

Somewhere in the WindowEngine.hpp file:
class WindowEngine
{
    // ...
    sf::RenderWindow mWindow;
    // ...
};

And then you'll have to change the function signature to use a reference and make use of the member variable.

sf::RenderWindow& WindowEngine::LaunchEngineWindow(void)
{
        int Height = 0;
        int Width = 0;

        GetScreenResolution(Height,Width);

        mWindow.create(sf::VideoMode(Width,Height,32),"Genesis",sf::Style::Fullscreen);

        mWindow.setMouseCursorVisible(false);
        mWindow.setVerticalSyncEnabled(true);

        return mainWindow;
}
 

Also since you probably don't understand the concept of passing stuff around by-value or by-reference, I advice you to pick up a C++ and read it or at least that section. It's basic and crucial knowledge.

Thank you very much! I was still unable to get it working without a non copyable error though. >_> I'm not sure if its something having to do with the way I try to retrieve the mainWindow from the main class, or if its the method of returning it in the WindowEngine.  ???

I'm new to C++ in general and have been learning it for a bit now, "used to program everything in java". I understand references when sending things between methods, but sending references between classes is fairly new to me. Well, I guess. Returning something as a reference between classes is very new. As For books... I'm going to college in a month for this stuff, xD I'll get books then... providing their books are actually decent and not a complete waste of money that is.

So theres nothing I have to change to my main class then? Because it seems like its still returning the mainWindow with "return mainWindow;" and its still getting the main window with, "sf::RenderWindow mainWindow = windowEngine.LaunchEngineWindow();" Correct me if I'm wrong "and I probably am" but doesn't that still make a copy of it? I mean, At the top of the method it does say reference with the "&" but it doesn't seem to be referencing because it still throws a nice litter error into my debug box. :/

Anyways, bit thanks for the help so far! I look foreward to hearing from you again. :D

:EDIT:

So after some snooping, light reading, looking over examples, more light reading, and tinkering. I wound up with this:

WindowEngine.cpp
#include "stdafx.h"
#include "WindowEngine.h"
#include <WTypes.h>
sf::RenderWindow& WindowEngine::LaunchEngineWindow(void)
{
        int Height = 0;
        int Width = 0;

        GetScreenResolution(Height,Width);

        mWindow.create(sf::VideoMode(Width,Height,32),"Genesis",sf::Style::Fullscreen);

        mWindow.setMouseCursorVisible(false);
        mWindow.setVerticalSyncEnabled(true);

        return mWindow;
}
sf::RenderWindow WindowEngine::ApplyResolutionChanges(int&Height,int&Width)
{
//Something will be here soon enough.
}
void WindowEngine::GetScreenResolution(int&Height,int&Width)
{
        RECT desktop;
        const HWND hDesktop = GetDesktopWindow();
        GetWindowRect(hDesktop, &desktop);
    Width = desktop.right;
    Height = desktop.bottom;
}
 

WindowEngine.hpp
#ifndef WINDOWENGINE_H
#define WINDOWENGINE_H
class WindowEngine
{
        sf::RenderWindow & mWindow;
public:
        sf::RenderWindow& LaunchEngineWindow();
        sf::RenderWindow ApplyResolutionChanges(int&Height,int&Width);
private:
        void GetScreenResolution(int&Height,int&Width);
};
#endif
 

Fortunettely it doesn't complain about things being copied anymore. Now it just has an error about having no suitable constructor. xD "no appropriate default constructor available" *sigh something else to learn about......Gotta love these learning expiriences xD

135
      So I've been trying to come up with a decent, yet simple way to do this, and I really can't think of anything. I've tried it many ways so far, all of which throw a non copyable error because the render window was copied and sent back to the requesting class/method.

       I just wanted to make it that a outside class could control the functions of creating/destroying/modifying/reloading the render window for instances of setting changes, like resolution changes, or switching from full screen to windowed.

        So far what I have, and yes I KNOW this won't work, and now looking at it, it seems kind of stupid given that it will throw an error the moment you even think of soing it this way. But I just wanted to ask for some input and or ideas on the subject, as for a practical way to do this.

in Main.cpp
        WindowEngine windowEngine;
        sf::RenderWindow mainWindow = windowEngine.LaunchEngineWindow();
 

int WindowEngine.cpp
sf::RenderWindow WindowEngine::LaunchEngineWindow(void)
{
        int Height = 0;
        int Width = 0;

        GetScreenResolution(Height,Width);

        sf::RenderWindow mainWindow(sf::VideoMode(Width,Height,32),"Genesis",sf::Style::Fullscreen);

        mainWindow.setMouseCursorVisible(false);
        mainWindow.setVerticalSyncEnabled(true);

        return mainWindow;
}
 

Anyways. I look foreward to hearing from you, and your great ideas!

Have a wonderful day! :D

Pages: 1 ... 7 8 [9] 10