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

Pages: 1 [2] 3
16
General discussions / Re: Incredible performace of Lua (luajit) over C++
« on: August 19, 2015, 02:54:22 pm »
Disclaimer, as I also replied and thus feel addressed: I was not being rude! :D I really just wanted to see the Lua code. I even think that it's possible that his tests outperform C++. JIT compilation is quite powerful, as it can optimize in a field where compile-time optimizers have already left the building.

I was only mainly talking about Nexus and his first comment which was completely unprovoked and just rude.

17
Feature requests / Re: Windows OS ::getDesktopMode() fix
« on: August 18, 2015, 08:34:50 pm »
Themes don't affect it. They simply change icons and colors. Also as I said in my original post there is a more dynamic solution which is using <window.h> to get the border width. Which would mean even if it changed you would be able to get the correct width.
Unfortunately it's not that easy either. There's a visible discrepancy between the actual border width (didn't try it, but I'm sure it's reported as either 0 or 1) and the visible border we've noticed.

I thought about adding a small patch to re-center the window horizontally in case it's bigger than the desktop, but I guess this would screw up multi-screen setups (which I can't test right now due to lack of desktop space).

Yeah, but for me even if I change border width the code I supplied works with that solution?

18
General discussions / Re: Incredible performace of Lua (luajit) over C++
« on: August 18, 2015, 07:41:11 pm »
I like a lot more C over C++.
Nice, but you're making a C++ comparison here. Personal preferences should not affect an objective and expressive benchmark ;)

3) Its faster ( OpenGL is faster that DirectX ) ( chipmunk-physics are faster than Box2d)
Sorry, but this is complete bullshit, especially with those examples. It's so fundamentally wrong I don't even know where to start. But you'll find these kinds of arguments all over the internet, there's no need to repeat them here... So I'd say we concentrate on the benchmark in this thread, no need for another C vs C++ flamewar.

I will see carefully of RAII , looks ougly but great for the memory leaks.
You should really read my article. Exactly this kind of unfunded myths are refuted.

To be honest, you're just giving me more and more the impression that you don't really know what you're talking about. No offense, but when you're trying to prove something (especially speed), you should be familiar with the programming language and measuring techniques -- or at least willing to incorporate improvement suggestions, rather than sticking to dogmas you've heard somewhere and never questioned.

We're still missing the Lua code, by the way :)

He just uploaded a benchmark of Lua code and C++ code. Seeing as you guys generally help people there's no need to be so rude to him:

"this is complete bullshit!"
"It's so fundamentally wrong I don't even know where to start"
"giving me more and more the impression that you don't really know what you're talking about"
"rather than sticking to dogmas you've heard somewhere and never questioned."

All he's done is uploaded a benchmark of his Lua engine vs SFML C++ engine and you suddenly go all defensive and start being rude to him. Perhap's you shouldn't even reply to comments seeing as when viewing your posts the first one includes a quote of someone saying your being offensive.

19
General discussions / Re: Tutorial :: Installing SFML with CodeLite IDE
« on: August 18, 2015, 07:36:06 pm »
Since this isn't really a "discussion", I think this would be much better in the tutorials section of the Wiki.

This is what the SFML page says:

General discussions
For everything that is not a help request

This isn't a help request

20
General discussions / Tutorial :: Installing SFML with CodeLite IDE
« on: August 18, 2015, 06:22:34 pm »
Introduction
To start off let's recap on what SFML and CodeLite are. SFML is a graphics library for C++ that is designed to be simple. SFML stands for Simple and Fast Multimedia Library. CodeLite is a IDE. IDE stands for intergrated development environment. In simple terms an IDE is a editor for code that has special tools to help you develop faster. CodeLite is open-source, cross-platform. First of all I'll go over installing CodeLite, CodeLite is only supported on these operating systems so make sure one of them is yours:

Windows 7
Windows 8
Windows 8.1
Windows 10
Debian / Ubuntu
Fedora / OpenSUSE
ArchLinux
Mac OSX 10.8 and later
FreeBSD (this has no installer)


This tutorial is designed for SFML 2.3.1 and CodeLite 8.1.


Installing CodeLite 8.1
Lets start installing CodeLite 8.1. Go to http://downloads.codelite.org Select a package depending on what OS your on and whether your 64bit or 32bit. I'm Windows 64bit. We will be selecting a "CodeLite Stable Release". So I'll be clicking on CodeLite 8.2.0 for Windows 64 bit Installer Direct Link | SourceForge. Click Direct Link. It should start downloading and once it has downloaded run the .exe. From there it's just the basics of installing programs.


Downloading SFML 2.3.1
Okay, now lets download SFML now that we have CodeLite. Head over to http://www.sfml-dev.org/download/sfml/2.3.1/. You can see there's tabs with: Windows, Linux, Mac and All. The "All" tab contains the source code. We will be downloading the pre-made SFML folder though. Select a tab depending on your OS. Then select a version depending on whether your 32 bit or 64 bit. I'm on Windows 64 bit. If your on WIndows your going to want to download "GCC 4.8.1 TDM (SJLJ)". Ignore the 4.7.1 version. Click on "Download". Once SFML 2.3.1 has download you will get a .zip folder. Open it up and you should see a folder in it called SFML 2.3.1. Drag that folder to your C: drive. You should end up with SFML 2.3.1 in the C: drive next to folders with names like Program Files and Users. If this is true then you have correctly downloaded SFML 2.3.1.


Creating a project in CodeLite
Now you may be thinking you can just open CodeLite and start writing majestic code! Sadly that's not true. What your going to want to do is open up CodeLite 8.1. You should see a main view with tabs such as "New Workspace", "Open Workspace", Forums", Wiki". Click on "New Workspace". Select C++ and click OK. Now you can select the location and name. I set my location in my documents folder. So my "Workspace Path" is:

C:\Users\[username]\Documents

Now you want to select a workspace name. I set mine as "CodeLiteProjects". Enable "Create the workspace under a separate directory". Then click OK. Now you want to create a project to use SFML out. Click on "File" at the top left of the CodeLite window. Then click "New" and then "New Project". You will see a window pop up with a green box saying "New Project". Below that there will be the word Template then tabs called things like "GUI", "Console", "Others". Click on the plus sign next to "Console". It should expand out to reveal more things. Select "Simple Executable (g++)" and then click "Next >". Now you will see another window with the word "Project Name" and "Project Path". Don't edit Project Path, that is correct by default. For project name enter anything you want. I'll enter "SFML-Demo". Make sure "Create the project under a seperatre directory" is enabled. Then click "Next >".
There should be one last window with the word's "Compiler" and "Debugger". Presuming you have Mingw installed these will by default be correct. Just click "Finish".


Running SFML 2.3.1 in CodeLite
Okay, now we are on the last part! All we need to do is make sure CodeLite knows where SFML 2.3.1 is downloaded to. You should have a project in the "Workspace View" under "CodeLiteProjects". There will be a arrow to the left of the name of your project. Click that to expand the project. Do the same for a folder called "src". Now double click on "main.cpp".
By default main.cpp will have some random stuff in. On the top of the CodeLite window there will be a tab called "Build" click that then click "Run". It will ask you whether you want to build. Say yes and then it should run. It should open a console window with the output "hello world". Close that window. Now we know CodeLite is compiling correctly.
All we have to do now is tell CodeLite where to find SFML 2.3.1. In the workspace view you have your project name. Right click on it. At the bottom of the opened bit there will be Settings. Click on that. Now we see the project settings. There's a few tabs on the left. Click on "Compiler". In the center of the new window you will see text saying "Include Paths". Next to that is a text box. Remember when you downloaded and moved SFML 2.3.1. I download it to the C: drive. So enter in that text box "C:\SFML-2.3.1\include". That is just saying to CodeLite to go to a folder in SFML called include and look at the files in that. Below that text box is another called "Preprocessors". Write in that "SFML_STATIC". Now click on "Linker" on the tabs at the left of the window. You will see a text box called "Libraries Search Path". Enter "C:\SFML-2.3.1\lib". That tells CodeLite to open the files in the SFML folder in the the lib folder. Below that is a text box called libraries. Click the "..." to the right of it. A window will pop up. In that write this:

sfml-graphics
sfml-window
sfml-audio
sfml-network
sfml-system


Now your nearly done! Click "OK" and you should return to the main window. Edit the main.cpp file and enter:

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "Majestic Window");
   
    while (window.isOpen())
    {
        sf::Event event;
       
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
            {
                window.close();
            }
        }
       
        window.display();
    }
}



Getting the DLLs
Now if you click "Build" and then "Run". You will be so happy! Then you get annoying popups with called System Error saying they can't find SFML files. How annoying! To fix this we need to add the SFML .dll files to the same directory as our project. Open up where you downloaded SFML (C:\SFML-2.3.1\bin) to and then navigate to the bin folder in that. Copy all the files in that. Then go to where your CodeLite project is (C:\Users\[username]\Documents\CodeLiteProjects\SFML-Demo). There should be a folder called "Debug". Go there and paste all the files. If you run the project now it will return more errors saying about more .dll files. Go to where you installed Mingw. In my case I had CodeBlocks with Mingw installed so it was at "C:\Program Files (x86)\CodeBlocks\MinGW". You should see a bin folder click on that. There's a LOT of files. Look for two dll's. Called libstdc++-6.dll and libgcc_S_sjlj-1.dll. Copy them both into the your SFML project's debug folder. If you run the project now it should work!


Finish!
Now, your finished getting SFML 2.3.1 to work with CodeLite 8.1. Go build some amazing SFML applications!

21
Feature requests / Re: Windows OS ::getDesktopMode() fix
« on: August 18, 2015, 05:18:49 pm »
...
While the window borders shrunk to 1 pixel thickness in Windows 10, Microsoft kept the old "thick borders"  behind the scenes for easier resizing.

Here you can see it in action:



As you can see, from the top, the cursor changes as the cursor touches the actual window.

But from the left, the cursor changes quite a bit earlier. This invisible part of the border is what causes that "gap" when displaying the windowed full screen with borders.
...

just thought that was very interesting 


...Also it clearly doesn't change with themes because I have a theme installed and it doesn't change.

but just because it doesn't change with the theme you're using does that guarantee that it won't be affected by ANY theme ?

and I think his point still stands

what if MS decides to change border width on the next windows 10 update ?
or what if it makes the border visible ?

Themes don't affect it. They simply change icons and colors. Also as I said in my original post there is a more dynamic solution which is using <window.h> to get the border width. Which would mean even if it changed you would be able to get the correct width.

22
Feature requests / Re: Windows OS ::getDesktopMode() fix
« on: August 18, 2015, 03:18:02 pm »
No, you can still reach the borders and resize. Just for some reason you have an extra invisible bit you can use. Also it clearly doesn't change with themes because I have a theme installed and it doesn't change.

23
Feature requests / Re: Windows OS ::getDesktopMode() fix
« on: August 18, 2015, 03:06:46 pm »
Quote
There should at least be a warning in the documentation. Otherwise for beginners it looks like the window hasn't been positioned correctly.
A warning about what? "If your OS has transparent borders for some stupid reason, remember that they still exist and take some space"?

Quote
Technically no, because if you use getDesktopMode() then the window does not work correctly.
Since it's because of the transparent borders, this problem should not be tied to the desktop mode. Any window placed programmatically at (x, y) will appear at (x + 9, y).

No, a warning saying something like "For some reason Windows 10 has transparent borders so using ::setPosition(0, 0) will actually work like ::setPosition(9, 0)".

The thing is the window is positioned wrongly. It isn't positioned at 0, 0. It gets moved 9 pixels across on Windows 10. It's literally as simple as checking whether the host OS is Windows 10 and if so then minus 9 pixels on the x. Instead of confusing people and having wrong displays on other computers.

24
Feature requests / Re: Windows OS ::getDesktopMode() fix
« on: August 18, 2015, 02:45:51 pm »
Correct, from a technical standpoint everything is correct, although it looks weird.

Technically no, because if you use getDesktopMode() then the window does not work correctly.

25
Feature requests / Re: Windows OS ::getDesktopMode() fix
« on: August 18, 2015, 02:44:48 pm »
So basically, it is just that on Windows 10, the border is fully transparent. So it is correctly positioned at (0, 0) after all, and there's no bug. So... what else is there to be said?

There should at least be a warning in the documentation. Otherwise for beginners it looks like the window hasn't been positioned correctly.

26
Feature requests / Re: Windows OS ::getDesktopMode() fix
« on: August 18, 2015, 02:04:12 pm »
Check my last post. It's a visual thing caused by Windows 10's visual style. The actual borders are thicker than the visible border.

So will this be changed? I'm guessing it would be pretty easy to check for the border size.

27
Feature requests / Re: Windows OS ::getDesktopMode() fix
« on: August 18, 2015, 01:55:32 pm »
I've actually just realized. Nobody's tested this on Windows 10? Could it possibly be a issue that's unique to Windows 10?

I'm using Windows 10 Home, 64 bit, 10.0. 10240 Build 10240 with a:
Intel(R) Core(TM) i7-45 10U CPU @2.00GHz, 2601 Mhz
processor.

28
Feature requests / Re: Windows OS ::getDesktopMode() fix
« on: August 18, 2015, 01:49:50 pm »
Are you using any custom styling program? By default, all Windows 10 title bars should be full white with a colored outline around the whole window. Your program clearly doesn't show that.

Edit:
Just for reference, this is what a standard Windows 10 window is supposed to look like:



Ah, that may be it actually. I'm using a theme for windows. Though as far as I'm concerned themes only change the colors and icons. They don't change the dimensions of anything.

29
Feature requests / Re: Windows OS ::getDesktopMode() fix
« on: August 17, 2015, 09:04:17 pm »
The window is offset from the left by 9 pixels. It's the correct size though. The offset I've discovered is simply the window frame which is fixed by using the code I said at the top.

30
Feature requests / Re: Windows OS ::getDesktopMode() fix
« on: August 17, 2015, 09:02:46 pm »
I just tested it and the window, with decorations and desktop size, is correctly placed at (0, 0). If there's some empty space (9 pixels) for you then this is actually a real bug, and a proper & complete report would be welcome ;)

I'd just like to make sure. You are using Windows right?

I believe I may of misread the documentation saying there's a problem with oversizing but then I've discovered something different? Using just this code:

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode::getDesktopMode(), "Majestic SFML Window");

    while (window.isOpen())
    {
        sf::Event event;

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

        window.clear(sf::Color::Black);

        window.display();
    }

    return 0;
}
 

On a Windows 10, 64 bit computer produces this:


Pages: 1 [2] 3
anything