This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() | |
{ | |
std::cout << "Podaj liczbę z zakresu <0; 20> a powiem Ci, czy jest to liczba pierwsza:\n"; | |
int number; | |
std::cin >> number; | |
if (number >= 0 && number <= 20) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() | |
{ | |
float a = 15; | |
float b = 10; | |
float h = 5; | |
std::cout << "PROGRAM OBLICZAJĄCY POLE TRAPEZU\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() | |
{ | |
std::cout << "Witaj swiecie!"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to properly setup SFML 2.4.2 (works on 2.0 and later) in Code::Blocks using GCC? | |
# NOTE: this document is updated to work with 2.5.0 which does not include libjpeg. | |
======================================================= | |
=== Project variables you need to set: | |
======================================================= | |
===================== | |
Name: "SFMLDirectory" | |
Usage: "$$(SFMLDirectory)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<ImportGroup Label="PropertySheets" /> | |
<PropertyGroup Label="UserMacros"> | |
<SFMLDirectory>E:\Programowanie\Biblioteki\SFML-2.4.2\</SFMLDirectory> | |
<SFMLLibrariesStaticDebug>sfml-graphics-s-d.lib;sfml-window-s-d.lib;sfml-audio-s-d.lib;sfml-network-s-d.lib;sfml-system-s-d.lib</SFMLLibrariesStaticDebug> | |
<SFMLLibrariesStaticRelease>sfml-graphics-s.lib;sfml-window-s.lib;sfml-audio-s.lib;sfml-network-s.lib;sfml-system-s.lib</SFMLLibrariesStaticRelease> | |
<SFMLLibrariesDynamicDebug>sfml-graphics-d.lib;sfml-window-d.lib;sfml-audio-d.lib;sfml-network-d.lib;sfml-system-d.lib</SFMLLibrariesDynamicDebug> | |
<SFMLLibrariesDynamicRelease>sfml-graphics.lib;sfml-window.lib;sfml-audio.lib;sfml-network.lib;sfml-system.lib</SFMLLibrariesDynamicRelease> | |
<SFMLDependencies>freetype.lib;glu32.lib;opengl32.lib;openal32.lib;ogg.lib;flac.lib;vorbis.lib;vorbisfile.lib;vorbisenc.lib;gdi32.l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CSightSense | |
: public IAISense | |
{ | |
public: | |
/* Reszta kodu... */ | |
/* Ta metoda bedzie wyswietlala pole widzenia i postrzeganych aktorow. */ | |
virtual void DrawDebug() override; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IAISense | |
{ | |
/* Tutaj reszta kodu... */ | |
public: | |
/* Ta metoda będzie wyswietlala informacje dla debugowania. | |
Przykladowo bedzie pokazywala dzialanie zmyslu wzroku (obszar widzenia, postrzeganych aktorow itp.) | |
Nie jest to metoda czysto wirtualna (=0) gdyz nie wymagamy, by klasy potomne musialy miec implementacje | |
tej metody. Zostawiamy ja domyslnie po prostu pusta. | |
*/ | |
inline virtual void DrawDebug() { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "../Include/SFMLShapes.hpp" | |
#include "../Include/Math.hpp" | |
namespace SFMLShapes | |
{ | |
sf::ConvexShape GeneratePie(const float & radius, const float & angle, unsigned int vertexCount) | |
{ | |
/* Nie mozemy utworzyc wycinka kola z mniej niz 3 punktow. | |
Zabezpieczamy przed nierozsadnym uzytkownikiem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Main.hpp" | |
namespace SFMLShapes | |
{ | |
/* Funkcja, ktora tworzy wycinek kola o promieniu radius, kacie 2*angle (wartosc angle w lewo i wartosc angle w prawo). | |
vertexCount to ilosc punktow, z ktorych bedzie skladal sie ksztalt. Minimalnie sa to 3 punkty (bardzo slaba dokladnosc, trojkat) | |
*/ | |
sf::ConvexShape GeneratePie(const float &radius, const float &angle, unsigned int vertexCount = 20); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Zwraca kopie tablicy z wszystkimi aktorami w poziomie. */ | |
inline TActorsV GetActors() const { return m_actors; } |
NewerOlder