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

Pages: [1]
1
Graphics / PNG loader might be broken in 1.2
« on: February 21, 2008, 01:25:18 am »
I will try what you suggest. But I have successfully used the same path naming with other smaller files. But the paths are stored in an xml file.

Will update you guys.

2
General discussions / screen flicker - vsync or double buffering
« on: February 19, 2008, 10:51:23 pm »
Just one question, when I do

Code: [Select]

sf::RenderWindow App;

App.Create(sf::VideoMode(1280, 768, 32), "SFML Window",sf::Style::Fullscreen, 4);


Is this using the win32?

Meaning, did stuff like:
Code: [Select]
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
              PFD_DOUBLEBUFFER;
SwapBuffers( hDC );

3
General discussions / screen flicker - vsync or double buffering
« on: February 19, 2008, 10:20:06 pm »
I tried looking up some GLUT double buffering examples. It is working on my computer with no flicker and seems pretty smooth.

In GLUT there is a way to initialize double buffering. How do I code double buffering anyway?

4
General discussions / screen flicker - vsync or double buffering
« on: February 19, 2008, 09:27:22 pm »
Thank you for your reponse. I tried your suggestion but there is no response.

How do I enable double buffering?

5
General discussions / screen flicker - vsync or double buffering
« on: February 19, 2008, 08:16:50 pm »
Hi,

My screen has a slight flicker due to the difference in refresh rates when I alternate the display of two sprites. This makes the rendering look a bit choppy.

How do I turn on vsync?

Some people use double buffering, check out this link
http://www.idevgames.com/forum/showthread.php?t=6750&page=2
http://www.esreality.com/?a=longpost&id=522789&page=1

6
General discussions / Place RenderWindow as Global
« on: February 19, 2008, 05:41:55 pm »
Sourceforge getting so slow to work with past week.

If ESC will get that error, if close the window by clicking on the cross seems ok.

Here is the code.

How do I make the window go full screen?

Code: [Select]

#include <fstream>
#include <SFML/Graphics.hpp>

sf::RenderWindow App;

bool render()
{
return false;

}
bool update()
{

        sf::Event Event;
        if (App.GetEvent(Event))
{
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
{
return true;
}
            // Escape key : exit
            if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
{
return true;
}

            // Resize event : adjust viewport
            if (Event.Type == sf::Event::Resized)
                glViewport(0, 0, Event.Size.Width, Event.Size.Height);
        }


   return false;
 
}


int main()
{
    // Create the main window
App.Create(sf::VideoMode(1280, 768, 32), "SFML Window");
 
    // Create a clock for measuring the time elapsed
    sf::Clock Clock;

    // Set the color and depth clear values
    glClearDepth(1.f);
    glClearColor(0.f, 0.f, 0.f, 0.f);

    // Enable Z-buffer read and write
    glEnable(GL_DEPTH_TEST);
    glDepthMask(GL_TRUE);

    // Setup a perspective projection
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(90.f, 1.f, 1.f, 500.f);


    bool Running = true;
    while (Running)
    {

if(update()) {
Running = false;
}
if(Running)
{
render();
App.Display();

}
    }

return EXIT_SUCCESS;
 
}

7
General discussions / Place RenderWindow as Global
« on: February 19, 2008, 01:06:53 pm »
I have been struggling with the slowness of your website. Sometimes cant even log in or read the forum.

I just tried your code suggestion of "App.Create" and encountered a possible bug.

Code: [Select]

    bool Running = true;
    while (Running)
    {

if(update()) {
Running = false;
}
if(Running)
{
render();
App.Display();
Helper::System_Log("Running");
}
if(!Running)
{
Helper::System_Log("Not Running");
}

    }
return EXIT_SUCCESS;


Once I exit the while loop, I encountered a Application Error
The instruction at .....referenced momery at ..... The memory could not be read.

Think there could be quick fix to this?

8
Graphics / PNG loader might be broken in 1.2
« on: February 19, 2008, 09:47:20 am »
I am also having problems loading an Image.

Code: [Select]
sf::Image anImage;
anImage.LoadFromFile("graphics\\background.png");


At first I thought it was the Bit Depth of 64 is the problem
1280X768, Bit Depth 64bit
but when reduced to 32 bit stilla problem
1280X768, Bit Depth 32bit

Just a suggestion, have you thought about using FreeImage? It has wide support for a lot of formats.

9
General discussions / Place RenderWindow as Global
« on: February 19, 2008, 07:32:43 am »
>1/ Using a global is bad, especially with this kind of class. Try to find a better design

I am, just trying to adapt my old work to your framework.
 :lol:

>2/ new will return you a pointer, so your App variable should be a sf::RenderWindow* in this case
Changed to this

Your examples thus far only deal with one main program. I need to reuse the "RenderWindow App" for other game states. How would I go about doing that if not using global variable?

10
General discussions / Place RenderWindow as Global
« on: February 18, 2008, 09:49:32 pm »
Hi Guys,

How do you do?  :D

I want to place "sf:RenderWindow App" as a Global variable.

I have Global.h and a Global.cpp.

In Global.h
Code: [Select]

#include <SFML/Graphics.hpp>
extern sf::RenderWindow App;

In Global.cpp:
Code: [Select]

#include "Global.h"
sf::RenderWindow App;


In Main.cpp:
Code: [Select]

App = new sf::RenderWindow(sf::VideoMode(640, 480, 32), "SFML Window");


Why cant I do this? If not how do I make RenderWindow global?

C:\_libraries\SFML\include\SFML/Window/Window.hpp(291) : error C2248: 'sf::NonCopyable::operator =' : cannot access private member declared in class 'sf::NonCopyable'
        C:\_libraries\SFML\include\SFML/System/NonCopyable.hpp(65) : see declaration of 'sf::NonCopyable::operator ='
        C:\_libraries\SFML\include\SFML/System/NonCopyable.hpp(42) : see declaration of 'sf::NonCopyable'
        This diagnostic occurred in the compiler generated function 'sf::Window &sf::Window::operator =(const sf::Window &)'[/code]

Pages: [1]