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

Pages: [1]
1
General discussions / Re: sf::Texture implemented in SFML 2
« on: August 29, 2011, 06:45:52 pm »
Quote from: "Haikarainen"
Quote from: "Laurent"
The only drawback of this modification is that you can't retrieve pixels from a texture, and thus from a sprite, anymore. For pixel-perfect collision detection you must now store the collision data yourself (which allows more optimizations, by the way).


Why was this needed? This breaks ALOT of stuff for me :/ also my project has been on ice in waiting for SFML2 Release, and now this? WHY? :( youre breaking my heart......



...


What about tile-based games (think legend of zelda/shining force)? If you have a texture loaded into video memory with all tiles (like: dirt, grass, stone, entrance). Wouldn't a texture.Copy(texture, coordinates,intrect) be the fastest way to go about this?

Also, it seems like it would be compatible with earlier versions - and give users greater freedom in their coding.

2
Window / SOLVED.. sort of.
« on: August 29, 2011, 08:40:03 am »
Hi Groogy - Yah, running in debug -

WELL - I got it to work! -- Sort of.

This seems to be an issue with vista and the DWM. - The CosmoScroll game I got to run by going to properties and disabling the "Desktop Composition"..

Soooo, I disabled aero and vuala, the program runs, at least for a few seconds until it terminates with an apphang.. but i'm not so concerned about this at the moment, seems the major problem has been solved.

Appreciate all the feedback, hope this helps someone in the future.

3
Window / Hrm.. Still not working
« on: August 29, 2011, 08:21:04 am »
I appreciate the feedback - still seems to have problems, no matter where I Window.Clear();..

So I simply created a very very simple program - taken (and modified to work) from the sfml documentation . This again works in full screen, but when windowed, it fails on me, it creates the window, blank, then hangs.

The code is:

Code: [Select]
#include <SFML/Graphics.hpp>
using namespace std;

int main(void)
{

 // Create a new render-window
 sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window",sf::Style::Default);//Fullscreen);

 // Create a new render-texture
 sf::RenderTexture texture;

texture.Create(500, 500);

 // The main loop
 while (window.IsOpened())
 {
    // Event processing
    // ...

    // Clear the whole texture with red color
    texture.Clear(sf::Color::Red);


    // We're done drawing to the texture
    texture.Display();

    // Now we start rendering to the window, clear it first
    window.Clear();

    // Draw the texture
    sf::Sprite sprite(texture.GetTexture());
    window.Draw(sprite);

    // End the current frame and display its contents on screen
    window.Display();
 }
}


I've tried with and without the sf::Default tag..

I'm thinking it's something to do with my OS version or hardware related in some way.

Running Nvidia GeForce 9600GT (with the latest drivers)
Windows Vista Version 6.0 (Build 6000).


I just don't see how it doesn't work in windowed mode, but works fine fullscreen, it's beyond my scope of understanding, just picking up sfml 3 days ago.

BTW - I should note, I downloaded a program made with C++/SFML called CosmoScroll - it also runs in windowed mode, but is blank on me (I can hear the music fine).

4
Window / Temp Solution - but only temp
« on: August 26, 2011, 04:54:47 pm »
Could this be a bug with sfml? I can get it to work when I change my code FROM:
Code: [Select]
 sf::VideoMode VMode(800,600,32);
    sf::RenderWindow Window(VMode,"Pong!");


TO:
Code: [Select]
sf::RenderWindow Window(sf::VideoMode::GetDesktopMode(),"Pong!",sf::Style::Fullscreen);

I've tried varations of Style to no avail, and infact, ONLY "sf::Style::Fullscreen" works. (I can get 800x600 to work (tested) and likely others as well), but only "Fullscreen"..

I also found one person with the same problem, but he also didn't seem to have a solution other than rebooting his computer (which doesn't work for me) -- see: http://www.sfml-dev.org/forum/viewtopic.php?t=1242&sid=0640b1a157b92b4388c95caa3f524932

Thanks.

5
Window / See-Through Window Problem
« on: August 26, 2011, 03:05:32 pm »
Having a bit of difficulty getting off the blocks here, and searched endlessly to try and solve this problem to no avail--

When I run my test code, it should simply open a window (and do a few simple things), however, the window that is opened is see-through (I can see whatever windows I have of other programs running beneath it, though it's screen shot of those programs (for example if it's a video, only the screen shot of the last frame appears in my 'sfml window')).

I've disabled windows opacity.
I tried Window.Clear() with various color schemes.
I've pulled out some of my hair.

Has anyone ever heard of this problem? I cannot find a way to solve it, just beginning here.

I'm running Windows Vista / Nvidia GeForce graphics card - my code is:



Code: [Select]
#include <SFML/Graphics.hpp>
#include <iostream>
#include <windows.h>
using namespace std;

int main()
{
    int counter = 0;

    sf::VideoMode VMode(800,600,32);
    sf::RenderWindow Window(VMode, "View My Photo Hoe"); //,sf::Style::Fullscreen);

    sf::Texture texture;
    if (!texture.LoadFromFile("hoserBz2009.jpg"))
    {
        std::cout<<"Could not load file: hoserbz2009.jpg"<<std::endl;
        return 1;
    }

     //sf::Sprite sprite(image);
     int h = texture.GetHeight();
     int w = texture.GetWidth();
     sf::Sprite sprite;
     sprite.SetTexture(texture);
     string str1 = "I bet you do not see me.";
     sf::Text txt1(str1);
     //sprite.SetImage(image);
    //sprite.SetPosition(100.0f,30.0f);
     std::cout << h << " " << w<<std::endl;


    sf::Shape Rect = sf::Shape::Rectangle (0,0,10,10, sf::Color::Red);

    while (Window.IsOpened())
    {
        sf::Event Event;
        while (Window.PollEvent(Event))
        {
            switch (Event.Type)
            {
                case sf::Event::Closed:
                    Window.Close();
                    break;
                default:
                    break;
            }
        }



        //Window.SetBackgroundColor(sf::Color(200,0,0));
        Window.Draw(sprite);
        Window.Draw(txt1);
        Window.Draw(Rect);
        counter++;
        std::cout<<"Displaying... "<<counter<<std::endl;
        Window.Display();
        Sleep(100);
          Window.Clear();

    } //end while loop

    Window.Draw(Rect);
    std::cout<<"Quit"<<std::endl;


    return 0;
}



All help appreciated!

Pages: [1]
anything