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

Pages: [1] 2
1
Graphics / Re: RenderWindow only displaying one object
« on: March 16, 2015, 06:58:19 pm »
Fixed it by glEnable(GL_DEPTH_TEST);

2
sfml changed it, I looked at the saving states but what I've seen sfml saves its states not the modernGL states. Also yes everything is working now, thank you for your help!

3
i stopped rendering it in openGL and rendered it in sfml. heres a youtube video of my current problem.


I figured out the issue you have to re enable glEnable(GL_DEPTH_TEST);
after playing a video!!:P

4
Graphics / Re: RenderWindow only displaying one object
« on: March 16, 2015, 08:16:06 am »
https://www.youtube.com/watch?v=KXBH5vVbYSo&feature=youtu.be


heres the youtube video of whats going on.

in the video i load the main menu then exit the program.

then I load the video state once the video is finished my state switches to the main menu.

but this time the main menu is only rendering one object the background which happen to be the last call on the draw stack.

5
Graphics / Re: RenderWindow only displaying one object
« on: March 16, 2015, 07:58:20 am »
The code involved in this is between multiple states so it is quite extensive, but what I can do is create a youtube video of the exact problem.

the flow is

-create movie

-update movie

-draw movie

-window display

-loop above

-when movie is finished switch states

-start drawing objects for the scene in modern openGL

-window display()


if I dont play a movie and just render my scene it works perfectly if I call the movie then after the movie is finished start rendering my scenes only the last object on the stack gets rendered.

because Im rendering the video with sfml then moving back to modern GL i know there is some upkeep with the states you have to do and I feel like that is the cause of the issue, when switching from sfml back to openGL rendering what should I do for the window openGL states? when switching from openGL to sfml what should I do with the states

6
Graphics / Re: Advise on collision detection using std::vector
« on: March 16, 2015, 07:54:28 am »
in regards to the intersect function
http://www.sfml-dev.org/documentation/2.0/classsf_1_1Rect.php

-the function sf::Rect::Intersect requires a parameter of type(const Rect< T > &rectangle)

-what you are doing is giving a type sf::Sprite

-what you want to do is call your sprite then call the function get localBounds() like:
sprite.getLocalBounds(); this might not return the box in view space it might be in model so try:
sprite.getGlobalBounds(); if the above doesn't work


-with regards to your vector question yes vectors are super fast to add nodes to, however if you are removing a lot of nodes from the vector you are going to be pushing and popping a lot

-consider looking into is linked lists
http://www.cprogramming.com/tutorial/lesson15.html

-if you are new to programming I would recommend sticking with vectors.



7
Graphics / RenderWindow only displaying one object
« on: March 16, 2015, 03:31:08 am »
hey,

So my current issue is after running a sfe::Movie something internally in SFML is switched to only render one object per sf::RenderWindow::display() function and specifically its the render object that was called last. Any ideas? thank you for your time. Could it be the RenderTarget needs glResetStates(); if so, is there a function that returns all RenderTargets currently active?

8
hey ceylo I ran into another interesting problem. After calling a movie and updating it and stuff afterwards sfml only seems to draw one object per display function. Is there something in the library that switches some setting in sfml to only draw one object per display function? Is it the RenderTarget that needs resetting how would I get the handle for the sf::Movie::RenderTarget??

9
the code just gives the first image of the video. Instead of drawing it, it saves to a png. if you're ever looking to add like an openGL functionality to the library, I'd be happy to develop that btw your library is legit. I'd love to see some openGL support!!

10
sf::Movie movie;

movie.openFromFile("insert file");
movie.play();
while(true)
{
movie.update();
sf::Texture tex =  movie.getCurrentImage();
sf::Image image = tex.copyToImage();
image.saveToFile("use a directory on your desktop");

}

the above code should work for debugging it. The only image saving to my desktop is the first image. So this above code will help reproduce the problem. The save to file should be a png. thank you again!

11
hm thats difficult without a working openGL framework. I dunno how to supply this, I could give you my openGL framework although it is a huge project.

12
sf::Movie movie;

movie.openFromFile("insert file");
movie.play();
while(true)
{
movie.update();
sf::Texture tex =  movie.getCurrentImage();

///do something that uses the tex to debug I use a gpu debugger

}

13
Specifically its just the getCurrentImage() isnt returning the current image its only returning the first image. So what other function do I have to call for the getCurrentImage() to return the currentframe. My openGL stuff is working perfectly its just the getCurrentImage is only returning the first image in the video. I am calling movie.update() before the current image so im confused why its not returning the current image. Do i have to call the draw function for the getCurrentImage() to move to the next frame?

14
movie.update();
                currentTexture = movie.getCurrentImage();

///////////////////////////////////////////////////////////////////////////////////

                pipeline->useVertexShader(pipeline->_VertPassThrough);
                pipeline->useFragmentShader(pipeline->_FragmentShader);

                glEnable(GL_TEXTURE_2D);
                glActiveTexture(GL_TEXTURE0);

                sf::Texture::bind(&currentTexture);
                pipeline->sendToShader("tex", 0);

                glBindVertexArray(vertexArray);

                glDrawArrays(GL_TRIANGLES, 0, vertexSize);

                glBindTexture(GL_TEXTURE_2D, NULL);
                glBindVertexArray(0);
                currentTime = 0.0f;


oh and I did movie.play(); the audio works perfectly. BTW thank you so much for responding so quickly, really appreciate it.

15
Hello Im using sfe::Movie to do cutscenes in my project. I am trying to use the sf::Movie::getCurrentImage() to get the current frame image then I am binding that image and drawing it using openGL. the problem is its only returning the first image. I am calling the function sfe::Movie::update(); before I get the image, according to the documentation this should work. thank you for your time.

Pages: [1] 2