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

Pages: [1]
General / Building multiple targets for MingW with CMake
« on: May 03, 2013, 04:22:46 pm »
Hi, I was wondering if it is possible to crate a makefile that will build Release and Debug versions of SFML with CMake.

What I'm doing now is load CMake, set target to Release, Configure, Generate, then run mingw32-make install, then go back to CMake, set the target to Debug, and repeat. I was wondering if there was some target that automatically built both versions.


General / #defines necessary for OpenGL
« on: May 15, 2012, 04:30:46 pm »
Not so much something I need help with but an oddity I was wondering if anyone else experienced, and if so how they dealt with it.

When I #include <SFML/OpenGL.hpp>, I need to add

#define GLAPI extern
#define APIENTRY

ahead of it.

This is only required once, but not having it causes conglicts in gl.h where there's a bunch of lines such as

GLAPI void APIENTRY functionname();

The preprocessor commands there seem to try to figure out the compiler and set defines for GLAPI and APIENTRY, but for some reason my MinGW installation isn't getting it right so I have to do it manually. But I'm not happy with sticking that there, knowing that if I try to rebuild the project elsewhere it's going to have to be removed.

I've tried to get it into the #define section of the project options, so it wouldn't sit in the code itself, but when I did I had the same problem as before, it complained that it could not recognize GLAPI and APIENTRY in gl.h.

Any ideas why this might be happening?

Using latest version of MinGW and Code::Blocks. I'm also including SFML/OpenGL.hpp ahead of SFML/Window.hpp and SFML/System.hpp, if that matters.

General discussions / Should we post compiler warnings from SFML?
« on: May 08, 2012, 05:59:00 pm »
I was wondering, should we bring up any warnings that the compiler throws at us here?

I've recently been working on tightening up my own code (proper documentation, turning up all warnings on the compiler, etc), and looking through the options in GCC I found a bunch of warnings not covered by -Wall (which is really counter-intuitive). Turning those on gave me a bit of work, and also pointed out some warnings from SFML itself.

I was just curious if we should bring these up at all. They're things like:

"..\..\libs\SFML-2.0-rc\include\SFML\System\Mutex.hpp | 48 |
warning: base class 'class sf::NonCopyable' has a non-virtual destructor."


"..\..\libs\SFML-2.0-rc\include\SFML\System\Mutex.hpp | 48 |
warning: 'class sf::Mutex' has pointer data members but does not override 'sf::Mutex(const sf::Mutex&)' or 'operator=(const sf::Mutex&)' "

It's actually just those two for a bunch of classes.

And I suppose I already brought it up, so not really much point asking if I should. Hmm. Sorry?

System / New line in sf::String
« on: May 06, 2012, 11:36:11 pm »
I'm sure this has been answered a hundred times, but the search function couldn't help me. Terms are too generic I guess.

I'm wondering how to stick the "new line" code in sf::String. I'm currently creating strings from ANSI literals; sf::String string ("The text"); but if I use the new line character '\n' it doesn't seem to be converted or stored. What's the proper way to do this?

Window / Is KeyPressed suppossed to fire once or continuously?
« on: July 09, 2011, 05:52:15 am »
Been working on my event loop, and noticed something that I wasn't expecting.

When you hold a key down, is it suppossed to spam 'KeyPressed' events, followed by a single 'KeyReleased' event when you let go, or am I reading the events wrong somehow?

Ok, did a little test. Apparently it has to do with the keyboard repeat rate in the Windows Control Panel. KeyPressed Events are fired at the same rate that you select there. Any clue how to avoid this (other than disregarding key pressed events until you find an appropriate keyreleased event, which don't get spammed)?

Further research would seem to indicate that this is how Windows is suppossed to behave. Since I was using a toggle anyway, it doesn't actually matter if I receive a lot of KeyPressed events as long as they don't alternate. So consider the question solved.

General discussions / Filesystem from SFML?
« on: June 30, 2011, 10:42:16 pm »
I figured I'd ask here to double-check, but I'm guessing the answer is no. Anyway, is there a way to interact with the file system from SFML? Something basic, like finding the names of the files in a directory and the like. If not, what would a good way of doing it be? I think Boost has a library for that?

SFML projects / Asteroids!
« on: June 17, 2011, 07:13:14 am »
Asteroids! blog

Latest post - 14/Nov/2011 - Giving shape to the world - One step closer to the dream.

Latest demo - 07/Nov/2011 - Framework-0.0.8 - Moved to zip files so that people didn't have to deal with unpacking 7z files.

Now with YouTube video! This should give the people that can't see the videos a glimpse of what I'm working on.

Basically, I started out with the grand, ridiculous dream of building a procedural universe. A sci-fi sandbox to fit an Elder Scrolls sort of open ended RPG into.

While this remains the ultimate goal of this project, it would be unrealistic to hope to reach that point on the first go. Instead, for it's first iteration, I want to make a relatively simple 'Asteroids 3D!' game, with newtonian physics and blastery, crashing (into the asteroids, hopefully not the computer) fun.

While still pretty up there in terms of difficulty, especially for a single developer's first attempt, it should be achievable in a reasonable timeframe.

The project's overarching goals, however, require a pretty robust framework be put in place. So that's what this project is about; trying to figure out a program design that will be extensible, flexible, portable (though this is low priority) and powerful enough for my needs, while still keeping it fun and focused.

My tools are the OpenGL SuperBible 5th edition, Code::Blocks, MinGW, SFML, GLEW, and Git. And not enough free time.

I'm keeping a blog detailing my efforts here. I began writing for myself, so it can be difficult to follow at times, but I've been improving in that regard.

It recounts my struggles with NeHe's tutorials and SDL before I knew anything about shaders vs. fixed pipeline. In this regard, the SuperBible has been awesome. Highly recommend it to anyone who wants to work with OpenGL. It also has a nifty library and tutorials I've been canibalizing as I go.

I had a GitHub repository but I started using BitBucket instead. TortoiseHg is a much nicer GUI, I think. I want to clean up the code a bit before I let other people peek a it, though. It's an embarrasing mess of spaghetti right now.

--- Updates ---
Monday, November 14th, 2011
Giving shape to the world - One step closer to the dream.

Monday, November 7th, 2011
Been a while. New demo out :D Lighting now works. So shiny!

Looking good. Looking real good.

Framework-0.0.8 - Moved to zip files so that people didn't have to deal with unpacking 7z files.

Monday, October 10th, 2011
New Demo out! Now with collision detection worked into it.
Framework-0.0.7 - Bouncy
Also posted on the blog, how space partitioning helps cut down on the computation required for collision detection.
Collision Detection - Part 3 - Space Partitioning - Divide and Conquer

Monday, October 3, 2011
Been a busy week, couldn't get a lot of work in, but I had time for an update to the blog.

Collision Detection - Part 2 - Resolution - What do we do after detecting the collision?

Monday, September 26, 2011
Collision Detection - Part 1 - Detecting it - I'm going to spend a few weeks explaining how I go about doing the collision detection in the program, with hopefully a working example by next week.

Monday, September 12, 2011
Framework-0.0.6r - Shooting is important.

It's full of stars! - Working on the background, so I can get rid of the green lines.

Deus Ex is fun, but it kills productivity.

Monday, September 5, 2011
Framework- - Got the chase camera working. Switch with C. Exit key set to P to avoid quitting by accident.

Saturday, September 3, 2011
New version is up!
Framework-0.0.5r - Cockpit view; camera now moves about the world. The ship itself isn't visible while in this view (currently). Got a background to keep yourself oriented and spread a few spheres about to spice things up.

Next up, working out why the chase view is being difficult.

Wednesday, August 31, 2011

Last update for today:
Framework-0.0.4r - Now with angular momentum!

Wednesday, August 31, 2011

After quite a bit of work, undoing and redoing stuff, I have a working demo:

Framework-0.0.3r - Sphere Edition
Framework-0.0.2r - Triangle Edition

Window / Creating a double-buffered window
« on: June 15, 2011, 07:04:22 pm »
I wanted to ask, because I couldn't see it mentioned in the documentation for sf::Window. When creating a rendering context, how do you request that the context be double buffered?

Wondering what the equivalent of
Code: [Select]
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL);would be in SFML.

General / Problem compiling SFML: 'GetThreadId' not declared in scope
« on: June 14, 2011, 01:05:43 am »
I only just started using SFML and running a few tutorials. I used Git to get the project from GitHub, and ran CMake and compiled without problems. A couple days later I saw there were a few more commits to the project, so I ran fetch, merge, and tried to recompile. It then ran into a couple problems, but I assumed I had done something wrong and still had the compiled libraries, so I didn't think much of it.

Today I downloaded the project for a fresh install into another computer, so I could code on it as well, and again the make failed. So I thought I'd post it here.

I'm using Win7 with MingW, using MSYS for the console (I tried with the Git Bash and had the same issue).

After configuring the makefile for MinGW in CMake, I cd to the directory and run mingw32-make install, and this is the output:

Code: [Select]
$ mingw32-make install
Scanning dependencies of target sfml-system
[  1%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Clock.cpp.obj
[  2%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Err.cpp.obj
[  3%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Lock.cpp.obj
[  5%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Mutex.cpp.obj
[  6%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Sleep.cpp.obj
[  7%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/String.cpp.obj
[  8%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Thread.cpp.obj
[ 10%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/ThreadLocal.cpp.obj
[ 11%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/MutexImpl.cpp.obj
[ 12%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/Platform.cpp.obj
[ 14%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/ThreadImpl.cpp.obj
D:\libs\SFML\src\SFML\System\Win32\ThreadImpl.cpp: In member function 'void sf::priv::ThreadImpl::Wait()':
D:\libs\SFML\src\SFML\System\Win32\ThreadImpl.cpp:63:33: error: 'GetThreadId' was not declared in this scope
mingw32-make[2]: *** [src/SFML/System/CMakeFiles/sfml-system.dir/Win32/ThreadImpl.cpp.obj] Error 1
mingw32-make[1]: *** [src/SFML/System/CMakeFiles/sfml-system.dir/all] Error 2
mingw32-make: *** [all] Error 2

Can't tell right now if it's the same problem I ran into in the other computer (meaning a commit maybe did something?) or some configuration issue on my end.

Pages: [1]