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.


Topics - OniLinkPlus

Pages: 1 [2] 3
16
Graphics / sf::Image::LoadFromPixels Size Limit
« on: October 23, 2010, 07:30:29 am »
Is there a size limit for images loaded with sf::Image::LoadFromPixels?

17
Audio / al.h Not Found
« on: August 21, 2010, 04:55:09 am »
Just wanted to let you know, on some Linux distros, such as Arch, al.h is located under the AL directory in include, so gcc can't find it since you include <al.h> instead of <AL/al.h>.

(stb_image is still warning filled too)

18
General / Massive Warning Wall in Build 1542
« on: July 31, 2010, 07:26:21 pm »
I just updated to Build 1542 and found a massive wall of warnings in stb_image.h:

In file included from ../../src/SFML/Graphics/ImageLoader.cpp:30:
../../src/SFML/Graphics/stb_image/stb_image.h:193: warning: comma at end of enumerator list
In file included from ../../src/SFML/Graphics/ImageLoader.cpp:30:
../../src/SFML/Graphics/stb_image/stb_image.h:782: warning: comma at end of enumerator list
In file included from ../../src/SFML/Graphics/ImageLoader.cpp:30:
../../src/SFML/Graphics/stb_image/stb_image.h:1828: warning: unused parameter ‘in_far’
../../src/SFML/Graphics/stb_image/stb_image.h:2572: warning: comma at end of enumerator list
../../src/SFML/Graphics/stb_image/stb_image.h:4235: warning: unused parameter ‘pal’
../../src/SFML/Graphics/stb_image/stb_image.h: In function ‘stbi_uc* stbi_gif_load_from_file(FILE*, int*, int*, int*, int)’:
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::h’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::out’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::flags’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::bgindex’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::ratio’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::transparent’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::eflags’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::pal’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::lpal’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::codes’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::color_table’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::parse’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::step’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::lflags’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::start_x’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::start_y’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::max_x’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::max_y’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::cur_x’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::cur_y’
../../src/SFML/Graphics/stb_image/stb_image.h:4526: warning: missing initializer for member ‘stbi_gif_struct::line_size’
../../src/SFML/Graphics/stb_image/stb_image.h: In function ‘stbi_uc* stbi_gif_load_from_memory(const stbi_uc*, int, int*, int*, int*, int)’:
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::h’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::out’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::flags’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::bgindex’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::ratio’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::transparent’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::eflags’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::pal’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::lpal’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::codes’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::color_table’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::parse’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::step’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::lflags’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::start_x’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::start_y’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::max_x’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::max_y’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::cur_x’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::cur_y’
../../src/SFML/Graphics/stb_image/stb_image.h:4544: warning: missing initializer for member ‘stbi_gif_struct::line_size’
../../src/SFML/Graphics/stb_image/stb_image.h: In function ‘uint8* stbi_gif_load_next(stbi*, stbi_gif*, int*, int)’:
../../src/SFML/Graphics/stb_image/stb_image.h:4470: warning: array subscript is above array bounds

Any way to fix this? I don't like having walls of warnings, they always make me feel like something is going to go wrong and screw up my programs.

19
SFML projects / Open Game Engine
« on: June 10, 2010, 02:46:40 am »
Hey everyone, I'm here today to talk about a project I've been working on for a while! It is called the Open Game Engine, and is, as the name says, a game engine that is open-source.

It is a very simple system, in my opinion. You have a basic engine class, a template main function in the Engine that is called from the program's main function, a base object class for describing objects in your game, and much more!

The template main function in the engine is meant to be a simple game loop which uses the event system to update things like key states, calls the update and draw functions of each object, and draws the window. It is very WIP, so suggestions are required.

Tutorials will be coming soon, as well. Doxygen documentation is included, and it is licensed under the zlib/libpng license, like SFML. It requires SFML2 to build.

The Mercurial repository is located at Bitbucket.

The engine is designed to make the programming of the average game a little easier, so I will not be adding systems that are only used in certain kinds of games, such as an accurate, real-time physics engine. I will only provide features which the average game will find useful.

PLEASE make suggestions! I really want to improve this!

20
General discussions / OniLink Tries to fix Bugs in Tasklist
« on: June 06, 2010, 11:55:19 pm »
Alright, so since Laurent seems to be busy, I decided to use my amazingly large amount of free time to fix whatever bugs in the tasklist that I can. The first bug I tried to fix was #160. Lines 450 to 454 in WindowImplWin32.cpp were changed to this:
Code: [Select]
// Resize event
case WM_SIZE :
{
    // Update window size
    RECT rectangle;
    GetClientRect(myHandle, &rectangle);
    myWidth  = rectangle.right - rectangle.left;
    myHeight = rectangle.bottom - rectangle.top;

    if (myWidth != 0 && myHeight != 0){
        Event event;
        event.Type        = Event::Resized;
        event.Size.Width  = myWidth;
        event.Size.Height = myHeight;
        PushEvent(event);
    }
    break;
}

I would assume this would fix the bug. I will be going through the tasklist and fix whatever bugs I can.

21
General / Rvalues and Move Semantics for SFML2?
« on: April 24, 2010, 08:11:24 am »
So, Laurent, as I'm sure you've heard, C++0x will Rvalues and Move Semantics for easy binding of variables to temporaries so that temporaries can be used outside of where they were defined(from what I can tell), and I remember you were having trouble with sf::View and temporaries, so I have a suggestion.
When C++0x is officially released, why not use the Rvalues to solve the problem with temporary views?

22
General / Segmentation Fault on Ubuntu x64?
« on: February 24, 2010, 03:18:47 am »
I'm using Ubuntu x64 right now, and when I try to run a program that is linked with the latest build of SFML2, I get a Segmentation Fault immediately. Even if I don't use any code from SFML. As long as my program is linked with SFML, I get segmentation faults.

23
Graphics / Code Generated Image does not display on Windows
« on: January 31, 2010, 12:44:56 am »
I have a RenderWindow with a size of 300x200, and an Image with the same size. I go through each pixel in the image and generate a color for it(Mandelbrot calculations), and when I try Window.Draw(sf::Sprite(Image)); then Window.Display();, the Window stays black as if the image were black. I know this is not true because I also SaveToFile("Mandelbrot.png") the Image, and that image looks just fine. The weirdest part is, I am getting no errors and the code works just fine on Ubuntu 9.10.

24
System / The Vector Functions
« on: January 23, 2010, 10:31:41 pm »
I see they haven't been implemented. Will they be added soon?
Some Vector functions you probably should do(and code for some of them) are:
Vector2
Code: [Select]
#include <cmath>

T Direction(){// May want to use double or float instead
    return atan2(y, x);
}

T Dot(Vector2<T>& Other){//May want to use double or float instead
    return x*Other.x + y*Other.y;
}

T Length(){
    return sqrt(x*x + y*y);
}

void Normalize(){
    T Length = Length();
    x /= Length;
    y /= Length;
}


Vector3
Code: [Select]
#include <cmath>

Vector3<T>& Cross(Vector3<T>& Other){
    return Vector3<T>(y*Other.z - Other.y*z, z*Other.x - x*Other.z, x*Other.y - y*Other.x);
}

T Dot(Vector3<T>& Other){
    return x*Other.x + y*Other.y + z*Other.z;
}

T Length(){
    return sqrt(x*x + y*y + z*z);
}

void Normalize(){
    T Length = Length();
    x /= Length;
    y /= Length;
    z /= Length;
}


I'll add more functions and examples as I think of them.

25
Graphics / Multithreading Error with Rendering
« on: January 20, 2010, 11:08:41 pm »
I have a separate Thread from Main. It has an sf::Context. It renders just fine normally, but when I switch Windows, then switch back, it fails to activate the Window's Context. So, if the window goes inactive even once, the context goes screwy. Should I be calling SetActive?

26
Graphics / Woooo Using Multithreading gives me White Images
« on: December 30, 2009, 10:32:16 pm »
Code: [Select]
#include <SFML/Graphics.hpp>
#include <iostream>
#include <string>
#include <list>
#include <map>

class ImageManager{
    private:
        std::map<std::string, sf::Image> images;
    public:
        ImageManager(){
        }
        sf::Image& Load(std::string file){
            if (images.find(file) == images.end()){
                images.insert(std::pair<std::string, sf::Image>(file, sf::Image()));
                images[file] = sf::Image();
                images[file].SetSmooth(false);
                images[file].LoadFromFile(file);
            }
            return images[file];
        }
        ~ImageManager(){
            images.clear();
        }
};

ImageManager Images;

class Object{
    private:
        sf::Sprite mySprite;
        sf::String myFilename, myParameter1, myParameter2;
    public:
        Object(){
        }
        Object(double X, double Y, sf::String Filepath, sf::String Param1, sf::String Param2){
            myFilename = Filepath;
            mySprite.SetImage(Images.Load(Filepath), true);
            mySprite.SetPosition(X, Y);
            myParameter1 = Param1;
            myParameter2 = Param2;
        }
        void LoadImage(sf::String Filepath){
            mySprite.SetImage(Images.Load(Filepath), true);
        }
        sf::Sprite& GetSprite(){
            return mySprite;
        }
        sf::String& GetParameter1(){
            return myParameter1;
        }
        sf::String& GetParameter2(){
            return myParameter2;
        }
        sf::String& GetFilename(){
            return myFilename;
        }
        ~Object(){
        }
};

sf::RenderWindow Window;
std::string Command;
sf::Vector2f LevelSize;
sf::Mutex Mutex;
Object CurrentObject;
std::list<Object> Objects;

bool CompareStrings(std::string stringsrc, std::string stringval){
    unsigned int length = stringval.length();
    if (stringsrc.length() < length)
        return false;
    for (unsigned int i = 0; i < length; i++){
        if (stringsrc[i] != stringval[i])
            return false;
    }
    return true;
}

void Console(void*){
    while (Window.IsOpened()){
        std::cin >> Command;
        if (CompareStrings(Command, "setsize")){
            std::cout << "Please enter the new Level Width: ";
            std::cin >> LevelSize.x;
            std::cout << "Recieved " << LevelSize.x << ". Please enter the new Level Height: ";
            std::cin >> LevelSize.y;
            std::cout << "Recieved " << LevelSize.y << ".\n";
        }
        else if (CompareStrings(Command, "setwidth")){
            std::cout << "Please enter the new Level Width: ";
            std::cin >> LevelSize.x;
            std::cout << "Recieved " << LevelSize.x << ".\n";
        }
        else if (CompareStrings(Command, "setheight")){
            std::cout << "Please enter the new Level Height: ";
            std::cin >> LevelSize.y;
            std::cout << "Recieved " << LevelSize.y << ".\n";
        }
        else if (CompareStrings(Command, "getsize")){
            std::cout << "Level Size is (" << LevelSize.x << ',' << LevelSize.y << ")\n";
        }
        else if (CompareStrings(Command, "setsprite")){
            std::cout << "Please enter the filename of the new sprite: ";
            std::string Filename;
            std::cin >> Filename;
            CurrentObject.GetFilename() = Filename;
            CurrentObject.LoadImage(Filename);
            std::cout << "Recieved " << Filename << ".\n";
        }
        else if (CompareStrings(Command, "setparameter1")){
            std::cout << "Please enter the new value for Parameter 1: ";
            std::string Param;
            std::cin >> Param;
            CurrentObject.GetParameter1() = Param;
            std::cout << "Recieved " << Param << ".\n";
        }
        else if (CompareStrings(Command, "setparameter2")){
            std::cout << "Please enter the new value for Parameter : ";
            std::string Param;
            std::cin >> Param;
            CurrentObject.GetParameter2() = Param;
            std::cout << "Recieved " << Param << ".\n";
        }
        else if (CompareStrings(Command, "getsprite")){
            std::string Filename = CurrentObject.GetFilename();
            std::cout << "The sprite's filename is " << Filename << ".\n";
        }
        else if (CompareStrings(Command, "getparameter1")){
            std::string Param = CurrentObject.GetParameter1();
            std::cout << "Parameter 1 is currently " << Param << ".\n";
        }
        else if (CompareStrings(Command, "getparameter2")){
            std::string Param = CurrentObject.GetParameter2();
            std::cout << "Parameter 2 is currently " << Param << ".\n";
        }
        else
            std::cout << "Invalid Function\n";
    }
}

int main(){
    LevelSize.x = 512;
    LevelSize.y = 512;
    Window.Create(sf::VideoMode(512, 512, 32), "Level Editor", sf::Style::Close);
    Window.SetFramerateLimit(50);
    sf::Thread Thread(&Console);
    Thread.Launch();
    while (Window.IsOpened()){
        sf::Event Event;
        while (Window.GetEvent(Event)){
            if (Event.Type == sf::Event::Closed || (Event.Type == sf::Event::KeyPressed && Event.Key.Code == sf::Key::Escape)){
                Window.Close();
                break;
            }
        }
        CurrentObject.GetSprite().SetPosition(Window.GetInput().GetMouseX()-(Window.GetInput().GetMouseX()%4), Window.GetInput().GetMouseY()-(Window.GetInput().GetMouseY()%4));
        Window.Clear();
        Window.Draw(CurrentObject.GetSprite());
        Window.Display();
    }
    return EXIT_SUCCESS;
}

This huge piece of code draws a White Image to the screen when it should be drawing the sprite  give to it, which in this case is a Full-Saturation Spectrum Gradient. Do you think it has something to do with me not using a Mutex?

27
Feature requests / Antialiasing Stepdown and Available Antialiasing Levels
« on: December 22, 2009, 06:01:57 pm »
I have an idea for you. Instead of just defaulting to an Antialiasing level of 2/0 if an attempt at a higher level of Antialiasing fails, why don't you "step down" much like the OpenGL Contexts? For example, my ATi Drivers allow Antialiasing Levels that are Powers of 2, why don't you step down between those Powers?

Also, could you possibly create a function that will allow us to see which Antialiasing Levels are available?

28
Graphics / sf::Shape::GetPosition() returns nan
« on: December 14, 2009, 05:33:23 am »
Ahhhh.
I'm trying to get the distance between two sf::Shapes in the latest SVN Build, but when I construct an sf::Shape, set its position, then try to get its x position with GetPosition().x, it gives nan, completely screwing up my simulation. HALP!

29
Feature requests / Vertex Shaders
« on: December 11, 2009, 04:46:09 am »
So you have Pixel Shaders working pretty well, I think that you should go ahead and allow us to write our own Vertex Shaders now. It would increase the Flexibility without needing too much to be changed. I am positive someone can find an use for Vertex Shaders in 2D, and if nobody can, then at least we can use gl* 3D Functions with 100% Custom Shaders!

30
Window / Build 1291 sf::Utf8 error when compiling
« on: November 27, 2009, 08:10:46 am »
Linux/WindowImplX11.cpp: In member function ‘bool sf::priv::WindowImplX11::ProcessEvent(XEvent)’:
Linux/WindowImplX11.cpp:702: error: ‘Utf8’ has not been declared

I get that when I try to compile the latest build on Linux. I ran make clean then make sfml, and it fails to compile libsfml-window.so with that error.

Fixed by replacing this line:
#include <SFML/System/Unicode.hpp>
with this line:
#include <SFML/System/Utf.hpp>

Pages: 1 [2] 3
anything