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 - Dejan Geci

Pages: [1] 2
1
Yes, this is a general software question. A quick google query with the "How do you know when to choose from inheritance from a class, inheritance from an interface, and components?" yielded a bunch of results ;)

2
I suggest reading about Component pattern - http://gameprogrammingpatterns.com/component.html. Great articles on that site. Also read about "composition over inheritance" principle, it should make things clearer.

3
This is a good question, I am also interested in the answer. Seems like you cant dispose of any window you create because they share some resource (probably GL context). The user can fullscreen-toggle himself out of memory.

4
DotNet / Re: How to use SFML.NET on linux/mono?
« on: September 29, 2015, 01:42:56 pm »
Haven't tried running it on Linux, but you probably have a DLL mapping issue. Basically, your app is looking for '.dll' files, but actual libraries for Linux end in '.so'. Check out this link: http://stackoverflow.com/questions/23448259/sfml-net-cant-locate-native-library-on-linux

You need to create a config file with dllmap for your app.

5
Graphics / Re: my path is correct but still cannot load the file
« on: April 16, 2015, 09:14:56 am »
And don't put a ; after your if.

This. You terminated the IF prematurely, so
std::cout <<"error";
will always execute.

As for the loading problem, go into your "Debug" directory and see if the JPG is there with your EXE.
Make sure the file name is correct - JPG or JPEG, and finally, make sure that the image is valid and it loads properly in editors and viewers.

6
DotNet / Re: SFML.Net 2.2 bug: Glyph.Advance too big
« on: April 10, 2015, 03:51:30 pm »
I think it's been fixed with https://github.com/SFML/SFML.Net/commit/659feb9a5fdf5d1f4553ee668da76b0abf655c03.

You have to build SFML yourself, or wait for 2.3

7
Graphics / Re: Random graphics glitch
« on: April 07, 2015, 05:18:43 pm »
If it happens in other software, it just might be a hardware/driver issue. Try to update the driver, and also try your application on another computer to verify it's working correctly.

8
Graphics / Re: sf::Texture initial slowdown
« on: March 30, 2015, 08:17:43 am »
How about this?

int main(int argc, char* argv[])
{
    sf::Texture texInit;

    size_t start = GetTickCount();
    size_t end = 0;
    sf::Texture tex;
    end = GetTickCount();

    printf("\nRuntime: %dms\n", (end - start));
        return 0;
}

9
Window / Re: How to display numbers in a window?
« on: March 26, 2015, 01:38:46 pm »
As Laurent said, you should load the font outside of the game loop. In your code, the font is loaded many times per second and it totally unnecessary :) Also check if the "font.ttf" is in the same folder as your .exe file. Does this work?

#include <string>
#include <sstream>
#include <iostream>
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600, 32), "Test", sf::Style::Default);

    sf::Font font;
    if (!font.loadFromFile("font.ttf"))
    {
        std::cerr << "error";
    }

    int number = 1000;
    std::ostringstream oss;
    oss << number;

    sf::Text text;
    text.setFont(font);
    text.setString(oss.str());
    text.setColor(sf::Color::Red);
    text.setPosition(400, 300);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();

        window.draw(text);

        window.display();
    }

    return 0;
}

10
DotNet / Re: Exception while loading SoundBuffer with SFML.net
« on: March 21, 2015, 09:00:21 am »
First of all, re-download the bindings from the site. You might have gotten a package which had included csfml-audio 64bit build by mistake. Also make sure that the platform target for you exe is x86 (in Visual Sudio - Project Properties -> Build -> Platform target = x86).

11
DotNet / Re: Performanceproblems with 2.2?
« on: March 20, 2015, 02:11:00 pm »
Tested with your CSFML build and there was no slowdown. Most likely and issue with libsndfile, as Laurent suggested.

12
DotNet / Re: Performanceproblems with 2.2?
« on: March 19, 2015, 01:50:18 pm »
I used Studio One to generate an empty ogg file, tested it in Winamp and it worked fine.

I will re-check it with another ogg.

13
DotNet / Re: Performanceproblems with 2.2?
« on: March 19, 2015, 08:01:14 am »
Reproduced:
namespace OggSlowdown
{
  using SFML.Audio;
  using SFML.System;

  class Program
  {
    static void Main(string[] args)
    {
      var oggMusic = new Music("Mixdown.ogg"); // Use attached file
      oggMusic.PlayingOffset = Time.FromSeconds(60 * 60); // Slowdown here
      oggMusic.Play();
    }
  }
}
 

14
DotNet / Re: SFML Game Development C# Port
« on: March 18, 2015, 01:08:51 pm »
Codebase updated to SFML 2.2.
- Using Clock and Time instead of Stopwatch and TimeSpan
- Indentation converted to 2-space

15
DotNet / Re: SFML.Net 2.2 Released
« on: March 16, 2015, 10:11:06 am »
32bit 2.2 package contains 64bit .NET dlls - please update it

Pages: [1] 2