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

Pages: [1] 2 3
1
General / Need help in creating a .dll/.so from .obj files?
« on: March 02, 2015, 09:07:55 am »
I don't want to do a long post on my question. I already done my research on how C++ compiles the code we write and after compilation phase, it gives .obj files which is passed to the linker to become an executable (i.e. .exe) or a shared library (.dll/.so). Now having this knowledge, I wanted to create a simple .cpp and .hpp file, get the .obj for this files and generate the .lib or .so for this project. I want it not tied to any platform, compiler, or IDE, unless it really can't be helped. Is this a complicated process that needs heavy study and research?

I also found out Cmake files used to generate project templates so it can be loaded to an IDE. It generates the library file (both static and dynamic) appropriate with the IDE, Compiler and the Platform I am using (.dll for Windows) which I used to develop games with. But I don't know how to do similarly for my project.

I hope you can enlighten me with steps after having .obj files and turning this into .dll/.so. Do I need a specific configuration that tells my whatever IDE or compiler that they are building a library not binary? Such that when I press the compile button on whatever IDE it produces the .lib/.so on the bin folder. I have seen library templates on both CodeBlocks and VSE, but I think this will not help me achieve what I wanted to do by tying my code to the IDE and Compiler I am using.

I hope you could provide me insights and enlightenment on this topic. Also, please correct me if I got the wrong perspective. Thank you.

2
General / Development concerns about SFML for Android?
« on: January 26, 2015, 03:51:31 am »
Hi, I have a few doubts regarding SFML Android but it is not the system in general but the development itself. You see, I am completely addicted developing my projects on Visual Studio and on Eclipse Kepler. Though I prefer coding C++ projects on Visual Studio my primary concern arises when SFML is available for Android. Would it force users to use say Eclipse instead of Visual Studio? As far as I have tried, Android on Visual studio is like a paid plug in, or not available on Express Editions, though I haven't tried the Community Version yet. I would like to continue developing application on Visual Studio. I haven't tried SFML for Android and it seems the development is underway and I am wondering if I have to switch IDE once I develop games for PC and Mobile.

TIA!


3
So I am able to build from source but when I visited the build folder, I can't seem to find the bin files? Any ideas? I am building Thor from source with SFML master from github. I downloaded Thor from github as well.

4
General / Thor > Visual Studio > Particle example file > No Particles drawn.
« on: September 17, 2014, 07:16:57 am »
So I copy pasted example codes to my configured project in Visual Studio 13. All is fine but when I ran the example codes I don't see any particles. I am using exploiter's build as suggested on my post on SFML. I am using his build since I am not able to build master versions of SFML and Thor from source.

The codes I am doing is the Particle example provded along in the bundle. I will not copy paste them here. I did not do any modification, just copied it and run. I only see the text and can only see the texture if drawn using sf::Sprite.

Do you think I missed something?

5
General / Unresolved external thor-d.dll
« on: September 14, 2014, 06:01:48 am »
Hey I need help, I am building Thor-master.  I used the SFML-master to build the 'latest' version of Thor. I remember I have to link Thor to Master version SFML when Thor using CMake looks for it. Generating project from CMake works fine but when I compiled it using Visual Studio 2013 this is what I get:

Error   2   error LNK1120: 1 unresolved externals   C:\libraries\Thor\build\branches\Thor-master-build\src\Debug\thor-d.dll   1   1   thor
Error   1   error LNK2019: unresolved external symbol "__declspec(dllimport) float __cdecl sf::operator/(class sf::Time,class sf::Time)" (__imp_??Ksf@@YAMVTime@0@0@Z) referenced in function "float __cdecl thor::getElapsedRatio(class thor::Particle const &)" (?getElapsedRatio@thor@@YAMABVParticle@1@@Z)   C:\libraries\Thor\build\branches\Thor-master-build\src\Particle.obj   thor

I badly needed thor right now. How can I resolve this?

Thanks.

6
General / Linker error using Visual Studio 2013
« on: May 10, 2014, 05:41:10 pm »
First off, I think I know where this problem stems. Let me start by explaining that I wanted to use SFML master from github so that I can use SFML with Thor. Well, for now I am just planning to use SFML on Visual Studio 2013 Express Edition. So I downloaded CMake to build Thor and SFML from source to give me the required binaries(.dll/lib files). Now there is problem, CMake doesn't have VS2013 express edition option for building so I built mine using VS 2012 in the hopes it will run anyway since I am using an earlier version. But in my surprise it didn't. As you can see I got this following error reading tutorials SFML Vertex Array:

1>------ Build started: Project: SFML Vertex, Configuration: Debug Win32 ------
1>  main.cpp
1>main.obj : error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
1>C:\Users\Neon Warge\documents\visual studio 2013\Projects\SFML vertex\Debug\SFML Vertex.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 

I firmly believe where this problem stems, incompatible versions right? Because the built was supposedly for VS 2012 not 2013. Actually I saw a post right here, about templates binaries for VS 2013. It's a solution, well, great! I can't recall the link by the way but I can google it. I am tired and sleepy right now so I can't do pasting the link here.

I don't know if the solution works, it ask me to download some few stuff about templates and what not. But the binary part is something I do not want. Since, I am using the actual source file on GitHub(for both SFML and Thor).

I hit a snag I no longer know what to do. I can't seem to render anything at all. Even sf::Color::[Color] doesn't even work without throwing linking errors.

So my question is, how can I build SFML and Thor for Visual Studio 2013 Express Edition. If there is no way, I can always switch back to Code::Blocks you know...

I prefer 'ONLY' the master files on github and able to use Thor with SFML on Visual Studio 2013 Express Edition.

That would be all, thanks! While you are reading this, rest assured I am also solving this problem alone. Internet is not helpful, even the MSDN resources. So thanks a lot!

7
hello, so I am actually making an asset manager, I know there are tools for these but I prefer my own implementations because I have my own specific requirements. So my Asset class has just one requirement, that is it needs to have the implementation details on way on how to load that particular asset. Just think of C#'s Func<T,R> and Action<T>. That is what I am trying to do. Because instead of inheriting from a class just to have your own load implementation is quite cumbersome. I just want to enforce that loading scheme must be on the application level.

Here is my actual implementation:

#ifndef ASSET_HPP
#define ASSET_HPP

#include<map>
using std::map;
using std::pair;

#include<functional>
using std::function;

#include<string>
using std::string;

#include<memory>
using std::unique_ptr;

namespace esc
{
        template<class T>
        class Asset
        {

                typedef map<string, unique_ptr<T>> AssetLibrary;
                typedef function<T*(const string &)> LoadMethod;

                public:

                        Asset();
                        explicit Asset(const LoadMethod &);
                        virtual ~Asset();

                        bool loadFromFile(const string & oname, const string & path);
                        bool deleteFromAssetLibrary(const string &aname);

                        size_t getSize() const;
                        T * getAsset(const string &);

                private:

                        AssetLibrary library;
                        LoadMethod loadMethod;
        };

        template<class T> Asset<T>::Asset(){}

        template<class T>
        Asset<T>::Asset(const LoadMethod &_m)
                : loadMethod(_m)
        {

        }

        template<class T>
        Asset<T>::~Asset()
        {
       
        }

        template<class T>
        bool Asset<T>::loadFromFile(const string &oname, const string &path)
        {
                if(T * asset = loadMethod(path))
                {
                        library.insert(pair<string, unique_ptr<T>>(oname, unique_ptr<T>(asset)));
                        return true;
                }

                return false;
        }

        template<class T>
        bool Asset<T>::deleteFromAssetLibrary(const string &oname)
        {
                if (library.find(oname) == library.end())
                {
                        library.erase(oname);
                        return false;
                }

                return true;
        }

        template<class T>
        size_t Asset<T>::getSize() const
        {
                return library.size();
        }

        template<class T>
        T * Asset<T>::getAsset(const string &oname)
        {
                if (library.find(oname) == library.end())
                        return library[oname];

                return false;
        }
}

#endif
 

This the Asset<T> class, where T is the type of the asset. It requires on how to load that T regardless of what library I am using.

The following code is the implementation details on GameApplication, game application has the function to load the asset.

#include<iostream>
using std::cout;
using std::endl;

#include "GameApplication.hpp"
...

sf::Texture * GameApplication::loadTextureFromFile(const string & path)
{
        cout << "Calling this function..." << endl;

        sf::Texture * t = new sf::Texture();
       
        if (!t->loadFromFile(path))
                return nullptr;

        return t;
}
...
 

So here's how I "tested" it.

...
        GameApplication app;
        app.setScreenSize(800, 600);

        esc::Asset<sf::Texture> asset(bind(app, &GameApplication::loadTextureFromFile, _1));
       
        if (!asset.loadFromFile("object1", "URL"))
        {
                cout << "ERROR: file not found" << endl;
        }

        //return app.run();
...
 

This code works, well at least in compiling those source codes, but I hit a wall. SFML says that I cannot access  private member declared in sf::NonCopyable but doesn't tell which member.

I might have overlooked something. Did I miss something?

PS. Also, don't lecture me yet on wrong designs this and that, that is 8) not what I actually came here for. I hope you understand. We'll talk about that on my next post.

I just wanna learn std::function so this more of like for learning purposes and this one really bothers me. Thank you any help there is.

8
General discussions / EGL/egl.hpp no such file directory.
« on: May 02, 2014, 02:12:00 pm »
I am compiling SFML-master source file. Why? Because I am following Thor's tutorial on building SFML with Thor, it seems SFML is gearing towards SFML3 ports on iOS and Android? It seems I've missed some missing files from the SFML master. I need to build from source so I can use build and use thor in my projects. I need help. This what is being thrown by the way...

||=== Build: all in SFML (compiler: GNU GCC Compiler) ===|
C:\Users\Neon Warge\Desktop\SFML-master\src\SFML\Window\EGLCheck.hpp|32|fatal error: EGL/egl.h: No such file or directory|
src\SFML\Window\CMakeFiles\sfml-window.dir\build.make|81|recipe for target 'src/SFML/Window/CMakeFiles/sfml-window.dir/GlContext.cpp.obj' failed|
CMakeFiles\Makefile2|207|recipe for target 'src/SFML/Window/CMakeFiles/sfml-window.dir/all' failed|
C:\libraries\SFML\branches\SFML 2.1-build\Makefile|115|recipe for target 'all' failed|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
 

Also I am using SFML 2.1-master and MinGW version 4.8.1 on CodeBlocks version 13.12
CMake 2.8.10.2, Windows 7

Thanks for any input on this...


9
General / How to handle dead characters in game?
« on: April 27, 2014, 04:28:00 pm »
Alright, I don't how to start this but I'll try. I do not know if I am dealing with a design problem. I have considered every moving things on my game as Objects class, they can live, they can die. When they die, what I do is I delete them. I don't know how heavy this Object class is in memory, so I just delete them when I don't need them (Assuming it doesn't leak). But not just that, when I want to write on C# or Java, I don't even have slightest idea how do you deal game objects that are dead(e.g. run out of HP etc.). Flagging them though is a nice idea. But if these objects, if ever, for example, becomes big and if the instance of an Object class (e.g enemy1, enemy2) become dead in the game, I don't want them on memory. Especially if the game spawns many of this things. This is what I am actually thinking.

How do you deal with this thing?

10
General discussions / I would like to express my gratitude to all of you!
« on: February 19, 2014, 05:54:54 am »
Hello SFML community! I am back again! As you can see with all the questions I have ask since the last few months, I was actually making a final project for college. We are actually developing new constructs for RTS games and we have named it as Route Defense and we are able to finish the game, albeit the fact we have some problems with the controls and design issues with SFGUI and such but we are able to pull it off. So thank you everyone! This community is great and active, I don't know if some of you are using SFGUI, but I would like to thank the community of SFML and SFGUI together! I am just so excited saying this that I don't have the luxury to type another post on their site but I swear the developers of SFGUI hang out around here. Again thank you SFGUI developers!

I am totally proud of what we have done since it is the first game we have developed and its an RD-RTS, it might not be the best out there but at least we have tried something that we have fruitfully achieved in the long run. Finally, the hard work pays off.

SO thank you again SFML and SFGUI community it had been a wonderful journey especially to the open source developers and to Laurent for this wonderful multimedia API!

Thank you again, thank you! Guys you are all awesome. Salute!

11
General discussions / I cannot download Bromeon::Thor
« on: January 10, 2014, 05:50:06 pm »
I went to the site download the file from github but when I build it is says particular error on the lib source file itself. I could fix it somehow but I just don't want to fiddle with the library source code. So I know that is being currently developed. Or I might be wrong.

Somehow I went and I wanted to download the version 1.1. But it download only few kb, I am using opera by the way. I cannot open the downloaded Thor 1.1 using 7z app which says it can open file archive etc. etc.

Is there any link available? Mirrors etc?

I am not able to check this post for awhile now I might return to this post tomorrow. Any links to download of actual source code could be great!(I cannot find the master copies of previous version of Thor in github, having difficulty navigating on that site.) :)

Thanks!

Information:
Using Opera
SFML 2.1
MinGW GCC 4.8.1 (i686-w64-mingw32) provided by exploiter

12
I just notice somehow SFML is not really for games but mainly for multimedia applications, but I see somehow that SFML has many known extended libraries like Thor or GUI functionality like SFGUI. I just wanna know will it ever be integrated in the near future? If not so, why not? Is it because SFML must maintain its general focus on wide range multimedia applications? I am just curious.

Thank you! :)

13
General / How to build SFML2.1 for TDM-GCC 4.8.1 in cmake?
« on: January 01, 2014, 07:47:37 pm »
Hello, I need to compile SFGUI on my pc but since the instruction on their site requires that SFGUI isn't compatible with MinGW GCC 4.7.1, I need to somehow upgrade my compiler to 4.8.1. And so I did. I have downloaded TDM-GCC 4.8.1 and integrated that to my computer and it seems to work well now and that I have made it to work for C::B version 12.

So I have decided somehow to replace SFML 2.0 with 2.1. So I am on Cmake thingy and I know how to use cmake it just that everytime I hit configure and specify my compilers for TDM gcc and g++ it produces this error for the downloaded 'source' of SFML 2.1:

CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Could not find cmake module file:C:/libraries/SFML/SFML2.1-build/CMakeFiles/2.8.10.2/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Could not find cmake module file:C:/libraries/SFML/SFML2.1-build/CMakeFiles/2.8.10.2/CMakeCXXCompiler.cmake
 

I am stuck and I lost. I am able to build SFML 2.0 src with no problem when I build it for 4.7.1 now I can't seem to manage this error.

I am using TDM MinGW 4.8.1 on 64bit Windows 7.




14
General / Detect mouse button hold?
« on: October 29, 2013, 04:18:53 pm »
How can I detect mouse button hold without doing a time interval thing??? Is that even possible? I am trying to distinguish between a single click against single click and hold. How can I do this in SFML?

15
General / Path Finding and Steering Behavior Thread
« on: October 26, 2013, 02:06:43 pm »
Alright, I'll quit posting new threads, I'll stick to this thread when I encounter problems regarding this subject.

Original Question: I am just wondering, can I ever use Steering Behavior: Collision avoidance without seek behavior??? Can that be possible?

Thank you so much!

Pages: [1] 2 3
anything