Panel użytkownika
Nazwa użytkownika:
Hasło:
Nie masz jeszcze konta?

Silnik do tworzenia gry 2d

Ostatnio zmodyfikowano 2013-12-15 23:55
Autor Wiadomość
dawid
Temat założony przez niniejszego użytkownika
Silnik do tworzenia gry 2d
» 2013-12-15 11:53:31
Cześć, chciałbym stworzyć dość prostą z pozoru gierkę, która będzie polegać na tym, że taki sobie ludek będzie biegał po labiryncie i zbierał monety. Na to wszystko będzie miał czas. Z każdym poziomem będzie trudniej(więcej monet, mniej czasu etc).
Mam do Was pytanie. Jaki silnik graficzny do tego zastosować? SFML, Allegro czy może jakiś inny?
P-99256
pekfos
» 2013-12-15 11:54:27
SFML.
P-99257
SeaMonster131
» 2013-12-15 12:24:38
Lub spróbuj Allegro5.
P-99265
polkom21
» 2013-12-15 12:35:25
SFML obiektowo a Allegro strukturalnie więc wybierz jak jest Ci wygodniej pisać. Ja polecam SFML.
P-99267
dawid
Temat założony przez niniejszego użytkownika
» 2013-12-15 16:17:55
A skąd pobrać SFML 2.1 i jak je skonfigurować?
Na tej stronie nie ma podanego SFML do Code::Blocks:
http://www.sfml-dev.org/download/sfml/2.1/
Ma ktoś może już skonfigurowane Code::Blocks pod SFML 2.1? Może mi ktoś przesłać w .rar/.zip już skonfigurowane? Bo nie mogę sobie poradzić z tym.
P-99289
pekfos
» 2013-12-15 16:24:40
Możesz sobie używać nawet notatnika, to nie ma żadnego znaczenia. Liczy się kompilator. Jeśli masz najnowsze C::B, to masz tam dołączone TDM GCC 4.7.1, bodajże. Jeśli używasz innego, pobierz źródła i kompiluj.
P-99290
dawid
Temat założony przez niniejszego użytkownika
» 2013-12-15 16:30:57
Ale kiedy nie da się najnowszym C::B niczego skompilować.

Kod:

C/C++
#include <SFML/Window.hpp>

int main()
{
    sf::Window oknoAplikacji( sf::VideoMode( 800, 600, 32 ), "Kurs SFML 2.0 - http://cpp0x.pl" );
    while( oknoAplikacji.isOpen() )
    {
        oknoAplikacji.display();
    }
    return 0;
}

Gdy wcisnę przycisk kompilacji pojawia się masa errorów i w nowej zakładce otwiera mi się plik o nazwie Config.hpp:

C/C++
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented;
//    you must not claim that you wrote the original software.
//    If you use this software in a product, an acknowledgment
//    in the product documentation would be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such,
//    and must not be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source distribution.
//
////////////////////////////////////////////////////////////

#ifndef SFML_CONFIG_HPP
#define SFML_CONFIG_HPP


////////////////////////////////////////////////////////////
// Define the SFML version
////////////////////////////////////////////////////////////
#define SFML_VERSION_MAJOR 2
#define SFML_VERSION_MINOR 1


////////////////////////////////////////////////////////////
// Identify the operating system
////////////////////////////////////////////////////////////
#if defined(_WIN32) || defined(__WIN32__)

// Windows
#define SFML_SYSTEM_WINDOWS
#ifndef NOMINMAX
#define NOMINMAX
#endif

#elif defined(linux) || defined(__linux)

// Linux
#define SFML_SYSTEM_LINUX

#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)

// MacOS
#define SFML_SYSTEM_MACOS

#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)

// FreeBSD
#define SFML_SYSTEM_FREEBSD

#else

// Unsupported system
#error This operating system is not supported by SFML library

#endif


////////////////////////////////////////////////////////////
// Define a portable debug macro
////////////////////////////////////////////////////////////
#if !defined(NDEBUG)

#define SFML_DEBUG

#endif


////////////////////////////////////////////////////////////
// Define helpers to create portable import / export macros for each module
////////////////////////////////////////////////////////////
#if !defined(SFML_STATIC)

#if defined(SFML_SYSTEM_WINDOWS)

// Windows compilers need specific (and different) keywords for export and import
#define SFML_API_EXPORT __declspec(dllexport)
#define SFML_API_IMPORT __declspec(dllimport)

// For Visual C++ compilers, we also need to turn off this annoying C4251 warning
#ifdef _MSC_VER

#pragma warning(disable : 4251)

#endif

#else // Linux, FreeBSD, Mac OS X

#if __GNUC__ >= 4

// GCC 4 has special keywords for showing/hidding symbols,
// the same keyword is used for both importing and exporting
#define SFML_API_EXPORT __attribute__ ((__visibility__ ("default")))
#define SFML_API_IMPORT __attribute__ ((__visibility__ ("default")))

#else

// GCC < 4 has no mechanism to explicitely hide symbols, everything's exported
#define SFML_API_EXPORT
#define SFML_API_IMPORT

#endif

#endif

#else

// Static build doesn't need import/export macros
#define SFML_API_EXPORT
#define SFML_API_IMPORT

#endif


////////////////////////////////////////////////////////////
// Define portable fixed-size types
////////////////////////////////////////////////////////////
namespace sf
{
    // All "common" platforms use the same size for char, short and int
    // (basically there are 3 types for 3 sizes, so no other match is possible),
    // we can use them without doing any kind of check
   
    // 8 bits integer types
    typedef signed char Int8;
    typedef unsigned char Uint8;
   
    // 16 bits integer types
    typedef signed short Int16;
    typedef unsigned short Uint16;
   
    // 32 bits integer types
    typedef signed int Int32;
    typedef unsigned int Uint32;
   
    // 64 bits integer types
    #if defined(_MSC_VER)
    typedef signed __int64 Int64;
    typedef unsigned __int64 Uint64;
    #else
    typedef signed long long Int64;
    typedef unsigned long long Uint64;
    #endif
   
} // namespace sf


#endif // SFML_CONFIG_HPP



-------------- Build: Debug in aaaa (compiler: GNU GCC Compiler)---------------

mingw32-gcc.exe -Wall  -g  -DSFML_STATIC   -IC:\Users\Dawid\Desktop\SFML-2.1\include -IC:\Users\Dawid\Desktop\SFML-2.1\include  -c C:\Users\Dawid\Desktop\C++\aaaa\aaaaa.c -o obj\Debug\aaaaa.o
In file included from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System.hpp:32,
                 from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/Window.hpp:32,
                 from C:\Users\Dawid\Desktop\C++\aaaa\aaaaa.c:1:
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/Config.hpp:129: error: syntax error before "sf"
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/Config.hpp:130: error: syntax error before '{' token
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/Config.hpp:156: error: syntax error before '}' token
In file included from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Clock.hpp:32,
                 from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System.hpp:33,
                 from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/Window.hpp:32,
                 from C:\Users\Dawid\Desktop\C++\aaaa\aaaaa.c:1:
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Time.hpp:35: error: syntax error before '{' token
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Time.hpp: In function `asSeconds':
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Time.hpp:60: warning: empty declaration
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Time.hpp:70: error: syntax error before "const"
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Time.hpp:80: error: syntax error before "const"
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Time.hpp:85: warning: type defaults to `int' in declaration of `Time'
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Time.hpp:85: error: storage class specified for parameter `Time'
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Time.hpp:85: error: syntax error before "Zero"
In file included from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System.hpp:34,
                 from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/Window.hpp:32,
                 from C:\Users\Dawid\Desktop\C++\aaaa\aaaaa.c:1:
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Err.hpp:32:19: ostream: No such file or directory
In file included from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System.hpp:37,
                 from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/Window.hpp:32,
                 from C:\Users\Dawid\Desktop\C++\aaaa\aaaaa.c:1:
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Mutex.hpp:83: error: syntax error before "private"
In file included from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System.hpp:39,
                 from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/Window.hpp:32,
                 from C:\Users\Dawid\Desktop\C++\aaaa\aaaaa.c:1:
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:32:18: locale: No such file or directory
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:33:18: string: No such file or directory
In file included from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System.hpp:39,
                 from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/Window.hpp:32,
                 from C:\Users\Dawid\Desktop\C++\aaaa\aaaaa.c:1:
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:51: warning: type defaults to `int' in declaration of `std'
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:51: error: storage class specified for parameter `std'
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:51: error: syntax error before ':' token
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:56: warning: type defaults to `int' in declaration of `std'
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:56: error: storage class specified for parameter `std'
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:56: error: conflicting types for 'std'
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:51: error: previous definition of 'std' was here
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:56: error: syntax error before ':' token
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:251: error: syntax error before ':' token
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:251: error: declaration of `operator' as array of functions
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:284: error: syntax error before "std"
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:306: error: syntax error before ':' token
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:318: error: syntax error before ':' token
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/String.hpp:345: error: syntax error before "const"
In file included from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System.hpp:40,
                 from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/Window.hpp:32,
                 from C:\Users\Dawid\Desktop\C++\aaaa\aaaaa.c:1:
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Thread.hpp:33:19: cstdlib: No such file or directory
In file included from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System.hpp:40,
                 from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/Window.hpp:32,
                 from C:\Users\Dawid\Desktop\C++\aaaa\aaaaa.c:1:
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Thread.hpp:41: warning: empty declaration
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Thread.hpp:42: error: syntax error before '}' token
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Thread.hpp:174: error: syntax error before "private"
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Thread.hpp:189: error: syntax error before "priv"
In file included from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System.hpp:41,
                 from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/Window.hpp:32,
                 from C:\Users\Dawid\Desktop\C++\aaaa\aaaaa.c:1:
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/ThreadLocal.hpp:79: error: syntax error before "const"
In file included from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System.hpp:43,
                 from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/Window.hpp:32,
                 from C:\Users\Dawid\Desktop\C++\aaaa\aaaaa.c:1:
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.hpp:32:21: algorithm: No such file or directory
In file included from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.hpp:731,
                 from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System.hpp:43,
                 from C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/Window.hpp:32,
                 from C:\Users\Dawid\Desktop\C++\aaaa\aaaaa.c:1:
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:53: error: storage class specified for parameter `offsets'
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:53: error: parameter `offsets' is initialized
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:55: warning: excess elements in scalar initializer
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:55: warning: (near initialization for `offsets')
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:55: warning: excess elements in scalar initializer
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:55: warning: (near initialization for `offsets')
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:55: warning: excess elements in scalar initializer
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:55: warning: (near initialization for `offsets')
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:55: warning: excess elements in scalar initializer
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:55: warning: (near initialization for `offsets')
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:56: warning: excess elements in scalar initializer
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:56: warning: (near initialization for `offsets')
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:59: error: parameter `trailingBytes' is initialized
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:59: error: `trailing' undeclared (first use in this function)
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:59: error: (Each undeclared identifier is reported only once
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:59: error: for each function it appears in.)
C:/Users/Dawid/Desktop/SFML-2.1/include/SFML/System/Utf.inl:59: confused by earlier errors, bailing out
Process terminated with status 1 (0 minutes, 0 seconds)
37 errors, 15 warnings (0 minutes, 0 seconds)
 

O co chodzi?
P-99291
pekfos
» 2013-12-15 16:35:25
O to, że plik w języku C++ ma rozszerzenie .cpp.
P-99292
« 1 » 2
  Strona 1 z 2 Następna strona