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

Pages: 1 [2] 3
16
SFML projects / SFMLTheora 1.3 - Play videos in SFML
« on: April 15, 2011, 07:25:35 pm »
Nope it still stutters for me with the latest update :(

17
SFML projects / SFMLTheora 1.3 - Play videos in SFML
« on: April 15, 2011, 11:27:59 am »
Hey can you please elaborate on that? I cant find that openal init code.

18
SFML projects / SFMLTheora 1.3 - Play videos in SFML
« on: April 15, 2011, 10:29:42 am »
Code: [Select]
bool PlayVideo(std::string name)
{
auto viddy = std::make_shared<SFMLTheora::Video>();
if(!viddy)return false;
viddy->LoadClip(name);
//viddy->SetX(0);
//viddy->SetY(0);
GLRenderer::GetInstance()->GetMainWindow()->EnableVerticalSync(true);

bool result = true;
bool stopvideo = false;

while(!viddy->IsDone())
{
sf::Event sfEvent;
while(GLRenderer::GetInstance()->GetMainWindow()->PollEvent(sfEvent))
{
 if(sfEvent.Type == sf::Event::Closed){result = false; stopvideo = true; break;}

 if((sfEvent.Type == sf::Event::KeyPressed) && (sfEvent.Key.Code == sf::Key::Escape))
 {
 viddy->Stop();
 //viddy->SetAudioGain(0.0f);
 result = true;
 stopvideo = true;
 break;
 }

 if ((sfEvent.Type == sf::Event::KeyPressed) && (sfEvent.Key.Code == sf::Key::F12))Screenshot();
}

if(stopvideo)break;

viddy->Resize(IniOptions::GetInstance()->window_width, IniOptions::GetInstance()->window_height);
viddy->Update(GLRenderer::GetInstance()->GetMainWindow()->GetFrameTime());
GLRenderer::GetInstance()->GetMainWindow()->Clear();
GLRenderer::GetInstance()->GetMainWindow()->Draw(*viddy);
GLRenderer::GetInstance()->GetMainWindow()->Display();
}

if(IniOptions::GetInstance()->vsync)GLRenderer::GetInstance()->GetMainWindow()->EnableVerticalSync(true);
else GLRenderer::GetInstance()->GetMainWindow()->EnableVerticalSync(false);

return result;
}


That is my code. Can you please test the library with sfml2. A lot of people use sfml2 and I hope this library will provide support for both sfml1 and sfml2.

I tried other video files and it still stutters. You can barely hear the audio just click click cluck click. I tried without dynamic memory and it still behaves the same

19
SFML projects / SFMLTheora 1.3 - Play videos in SFML
« on: April 14, 2011, 07:19:45 pm »
Ah yes your exactly right. I somehow messed up the folder. Deleted everything and used 1.2.1 and it doesnt cause any heap errors.

However now there seems to be some weird audio skipping. It kind of stutters.
Although when I restart pc it works first time perfect and the second time starts stuttering.

Do I need to call release or something?

20
Window / Small error with sfml2
« on: April 14, 2011, 07:17:28 pm »
I just included most of the sfml files into my project.

21
SFML projects / SFMLTheora 1.3 - Play videos in SFML
« on: April 14, 2011, 04:48:40 pm »
viddy->Stop does not exist?

22
SFML projects / SFMLTheora 1.3 - Play videos in SFML
« on: April 14, 2011, 04:44:21 pm »
Already tried normal new/delete and guess what running it of the stack causes stack corruption.

23
Window / Small error with sfml2
« on: April 14, 2011, 04:42:41 pm »
I configured visual studio to be unicode.
I dont use cmake.

24
Window / Small error with sfml2
« on: April 14, 2011, 04:09:21 pm »
Code: [Select]
void WindowImplWin32::SetTitle(const std::string& title)
{
    SetWindowText(myHandle, title.c_str());
}


line 270 windowimplwin32.cpp

Cant compile this with unicode. Had to use mbstowcs

25
SFML projects / SFMLTheora 1.3 - Play videos in SFML
« on: April 14, 2011, 03:47:56 pm »
Hi, thanks for fixing the onseek thing.

Actually I wasnt deleting shared_ptr. I know that it doesnt need to be deleted manually. What I meant by it being deleted was the shared_ptr simply going out of scope.

Heres my code to play videos, I still get the heap corruption :(

Code: [Select]
bool PlayVideo(std::string name)
{
auto viddy = std::make_shared<SFMLTheora::Video>();
if(!viddy)return false;
viddy->LoadClip(name);
//viddy->SetX(0);
//viddy->SetY(0);
//GLR->GetMainWindow()->UseVerticalSync(true);

bool result = true;
bool stopvideo = false;

while(!viddy->GetVideoClip()->isDone())
{
sf::Event sfEvent;
while(GLRenderer::GetInstance()->GetMainWindow()->PollEvent(sfEvent))
{
 if(sfEvent.Type == sf::Event::Closed){result = false; stopvideo = true; break;}

 if((sfEvent.Type == sf::Event::KeyPressed) && (sfEvent.Key.Code == sf::Key::Escape))
 {
 viddy->GetVideoClip()->stop();
 viddy->GetVideoClip()->setAudioGain(0.0f);
 result = true;
 stopvideo = true;
 break;
 }

 if ((sfEvent.Type == sf::Event::KeyPressed) && (sfEvent.Key.Code == sf::Key::F12))Screenshot();
}

if(stopvideo)break;

viddy->Update(GLRenderer::GetInstance()->GetMainWindow()->GetFrameTime());
viddy->Resize(IniOptions::GetInstance()->window_width, IniOptions::GetInstance()->window_height);
GLRenderer::GetInstance()->GetMainWindow()->Clear();
GLRenderer::GetInstance()->GetMainWindow()->Draw(*viddy);
GLRenderer::GetInstance()->GetMainWindow()->Display();
}

//if(!options.vsync)GLR->GetMainWindow()->UseVerticalSync(false);
return result;
}

26
SFML projects / SFMLTheora 1.3 - Play videos in SFML
« on: April 13, 2011, 12:03:22 am »
Hi, No matter what I do the instance of
auto viddy = std::make_shared<SFMLTheora::Video>();
allways causes a heap corruption when shared_ptr is being deleted.

I am using sfml2 and 1.2 version of your library.
Any suggestions?

I had to add OnSeek again just like the bugfix from 1.0

27
Window / [SFML2] Input on another thread
« on: December 19, 2010, 03:43:53 pm »
Ah I see well now im thinking of just launching another thread to handle the event itself. But still having the event processing on the main thread.

It doesnt become unresposive anymore thanks.

Do you know how much of a performance decrease doing the whole while loop of GetEvent is on the rendering thread? I dont have any profiling experience so I dont know.

28
Window / [SFML2] Input on another thread
« on: December 19, 2010, 01:19:03 am »
Whats happening so far is:

Render loop on main thread with while(GLR->GetMainWindow()->GetEvent(Event)){blah;} works fine

As soon as I move the while(GLR->GetMainWindow()->GetEvent(Event)){blah;} to a worker thread it stops working.

Its not even using input objects right now
its just accessing a window that was creating on the main thread.

Any suggestions>?

29
Window / [SFML2] Input on another thread
« on: December 18, 2010, 08:02:07 pm »
Thanks a lot for replies im going to try to change the input object when I get home.

As for the sleep thing, my update loop is pretty large. theres all sorts of raycasts and sound checks going on im pretty sure it doesnt need to sleep, but then again I can allways experiment later on

30
Window / [SFML2] Input on another thread
« on: December 18, 2010, 03:09:56 am »
all the game logic
ie everything but opengl calls

Pages: 1 [2] 3