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

Pages: [1] 2
1
SFML projects / Re: My small 2D game creation software - [Game Inventor]
« on: January 19, 2014, 01:23:09 pm »
Hi,

If you have downloaded Game Inventor, please also download the the sample games and try to run the games. See if there are any problems on your OS, e.g. distorted display, OpenGL display problem, etc.

Please report your operating system and hardware spec in this post.

Thank you for your kindly help!! :)

2
SFML projects / My small 2D game creation software - [Game Inventor]
« on: January 08, 2014, 01:23:20 pm »
Hi All,

I have created a small game creation tool - Game Inventor.
It is a game authoring system inspired by Game Maker.
I have used SFML as the core runtime system - the graphics and sounds modules are adopted into Game Inventor.
For other functions such as game device input, networking, XML, SQLite and scripting, I use Qt to implement.

Please go to my Game Inventor website to have a look.

http://gameinventor.hostei.com/

However, at the moment I only have three mini example games for you to play with.
Tutorials are not ready yet. Only have a brief manual to read for.
Sorry for that.

If you are interested in it. Download it and make your games with it.
Game Inventor is totally freeware!!

Hope you may like it.
Thanks for reading this post.

Carlos Leung

3
General / Re: Template game can't run on other Mac
« on: December 24, 2013, 04:45:05 am »
Have you add the frameworks or dylib to your app bundle?

yourgame.app/Contents/Frameworks/dylibs or frameworks

4
General / Re: Problem about integrating SFML 2.0 into Qt (Mac OS X)
« on: December 21, 2013, 07:18:33 am »
I changed to use Qt 5.2.
It can create the SFML context successfully.
And the winId() should be casted into sf::WindowHandle

sf::RenderWindow::create((sf::WindowHandle)winId());

5
General / Re: Problems about Integrating SFML 2.0 to Qt 4.7.4(Ubuntu 13)
« on: December 15, 2013, 11:35:35 am »
I have figure out what's wrong.

The X11 headers should be included after SFML header

#ifdef Q_WS_X11
    #include <Qt/qx11info_x11.h>
    #include <X11/Xlib.h>
#endif

And .pro should add

LIBS += -lX11

It is OK now.

Happy Coding!!

6
General / [Solved] Problem about integrating SFML 2.0 into Qt (Mac OS X)
« on: December 15, 2013, 06:18:33 am »
I follow this tutorial http://sfml-dev.org/tutorials/1.6/graphics-qt.php to integrate SFML 2.0 into Qt 4.7.4

Problem:
I need to cast the winId() into void pointer:
sf::RenderWindow::create((void *)winId());

I am not sure this is correct or not.

On Mac, SFML failed to create the context.
The render window is blank, and debug output always gives:

invalid drawable

Any solution?

Thanks.

7
I follow this tutorial http://sfml-dev.org/tutorials/1.6/graphics-qt.php to integrate SFML 2.0 to Qt on Ubuntu 13.10.

But this code cannot be compiled:

#ifdef Q_WS_X11
            XFlush(QX11Info::display());
#endif

Error message are:

error: incomplete type 'QX11Info' used in nested name specifier
error: 'XFlush' was not declared in this scope

I have included as the tutorial does.
#ifdef Q_WS_X11
    #include <Qt/qx11info_x11.h>
    #include <X11/Xlib.h>
#endif

If I comment out this XFlush(QX11Info::display());, it can compile but nothing is displayed on Qt window and give this error message in appplication output:

Failed to activate the window's context

Any idea about this problem? How to fix it?
Thanks.

8
General / Re: What is better - QT Graphics or SFML?
« on: March 25, 2013, 06:43:28 am »
I have tried use Qt's graphics framework to write a small game engine.
Qt's graphics drawing commands are damn slow.
It takes several milliseconds to finish one drawing.
How slow it will be if there are thousands of drawings per frame?

Finally I switch to use SFML, it is much much faster.

Good luck.  ;)

9
Graphics / Re: Any size limitation on RenderTexture?
« on: October 06, 2012, 09:56:11 am »
sf::RenderTexture has the same size limit as sf::Texture, which is given by Texture::getMaximumSize().

The video memory usage of the texture is width * height * 4 bytes.

Got it. Thx!

10
Graphics / Any size limitation on RenderTexture?
« on: October 06, 2012, 09:37:30 am »
Hi,

Does RenderTexture has size limit?
Is it depends on hardware capability?
And how to calculate the memory usage of a RenderTexture?

Thanks.

11
Graphics / Re: setFont from a font loaded from memory crashes program
« on: October 02, 2012, 09:20:41 am »
Thanks for your reply, Laurent.

I find out the reason.

I should pass a const char* pointer instead just of char* to loadFromMemory(const void *data, std::size_t sizeInBytes)

this works fine
m_font.loadFromMemory(byteArr.constData(),byteArr.size());
 

12
Graphics / setFont from a font loaded from memory crashes program
« on: October 02, 2012, 04:31:21 am »
Hi all,

I loaded a font file from memory, then immediately setFont to a sf::Text, but don't know why the program crashes and force to quit.

bool ok = m_font.loadFromMemory(byteArr.data(),byteArr.size()); // byteArr is QByteArray stored in a QMap
if(ok)
{
        qDebug() << "load font from memory ok";
        m_text.setFont(m_font); // call this function crashes program
}else
{
        qDebug() << "load font from memory failed";
}
 

but I use sf::Font::loadFromFile() is OK, draw text correctly

QString path = "....a font file path...";
m_font.loadFromFile(path.toStdString());
m_text.setFont(m_font);
 

where m_font is a sf::Font member variable of a RenderWindow subclass
m_text is sf::Text member variable of the same RenderWindow subclass
the font file used is a Chinese font with size > 5MB

PS: I use Qt 4.7.4 with MinGW

Thanks.

13
General / Re: How to convert sf::String to QString and convert back?
« on: September 30, 2012, 09:24:59 am »
Look at the doc: there are only three functions that convert a sf::String to a common representation (std::string, std::wstring and UTF-32).

Now look at the documentation of QString: there are many functions that convert a regular string to a QString: fromStdString, fromStdWString.

So........ ;)

QString::toStdWString() works for UTF-8 characters, it can feed into a sf::String and drawn.

Thanks.

14
You should have nothing to do. What happens currently?

The problem is when the Qt window resizes, the inner sf::RenderWindow remains the same size, it won't scale or stretch all all.
But I want it to scale/stretch to fit the container window size.

Any idea to do that?

15
Hi,

I follow the SFML tutorial to subclass a QWidget from SFML RenderWindow.
But I have no idea how to scale the render window when the QWidget window resizes.

Assume the render window is 640 * 480, the QWidget window is resized to 800 * 600,
is that I need to resize render window to 800*600 and scale everything by a scaling factor for drawing?

Pages: [1] 2