Welcome, Guest. Please login or register. Did you miss your activation email?

Recent Posts

Pages: [1] 2 3 ... 10
1
If it is crashing, can you tell us at which point in the code that it stops?

As an aside, it's worth noting that GLclampf is clamped to 0-1 range so checking to see if it's higher that 1 doesn't make sense.
If you do need to 'go over' so you can cycle, use a float (or a GLfloat). Also, it is a bit simpler to just add the value every time and then check if it's over 1 and drop it if it is (again, still using a non-clamped float).
e.g.
static float color{ 0.f };

color += 1.f / 256.f;
if (color > 1.f)
    color = 0.f;
2
General / Re: How can I make a background repeat infinitely?
« Last post by Hapax on February 01, 2023, 05:07:46 pm »
I presume the older code for this that you may have seen is this:
https://en.sfml-dev.org/forums/index.php?topic=14382#msg101088
(or this: https://en.sfml-dev.org/forums/index.php?topic=14382#msg101171)

If you have not seen that one, have a look; it should solve your issue!

If you have seen it, however, it's possible you might have misunderstood how it works...
It does use the repeated texture feature but it doesn't create an "infinitely large rectangle", it uses a rectangle just large enough to cover the background plus some spare to allow scrolling (maximum spare should be the size of the texture once).
It covers scrolling in both directions (x and y) but if you don't scroll in the y direction, it'll work just as well although you could fine-tune the y stuff if you really wanted.

Oh, and it does it all automatically! Just set your view position and it updates around that!  :)
3
Graphics / Re: Problem with clicking and dragging rotated rectangles.
« Last post by Hapax on February 01, 2023, 04:48:05 pm »
And, of course, the location of the origin of the shape is just the shape's position ;D

It's worth noting, also, that you are using "proj->getOrigin().x" for the y offset...
4
SFML projects / Re: [Android - HTML5] I Can Transform : All Stars Racing
« Last post by IsDaouda on January 31, 2023, 11:12:14 am »
Hi,
I hope you are doing well!

This is one of the toughest Mini Bosses in I Can Transform!

https://youtu.be/mzcjKeyXrok

Game link:
Web (HTML 5) version
Android version
PC (Windows, Linux, macOS) version

Have a nice day!
5
SFML website / Re: signature is confused about smileys
« Last post by Stauricus on January 30, 2023, 02:18:47 pm »
oops, I forgot the .html extension. thanks!
6
SFML website / Re: signature is confused about smileys
« Last post by eXpl0it3r on January 30, 2023, 02:07:17 pm »
I've enabled it. Your link doesn't actually work btw ;D
7
SFML website / signature is confused about smileys
« Last post by Stauricus on January 30, 2023, 01:47:22 pm »
Its says you can use smileys in the signature. Then it says you can't  :P





8
Will check the CMakeList.text method later, back to the first initial problem.
I tried running the line of code as you described and used the MIGW32-make (which is working), here is it it contains EVERY cpp file:
compile:
   g++ -c main.cpp AIComponent.cpp AIFollow.cpp AIOption.cpp AnimationComponent.cpp AttributeComponent.cpp Bird1.cpp Bow.cpp CharacterTab.cpp DefaultEditorMode.cpp EditorMode.cpp EditorState.cpp Enemy.cpp EnemyEditorMode.cpp EnemySpawnerTile.cpp EnemySystem.cpp Entity.cpp Game.cpp GameState.cpp GraphicsSettings.cpp Gui.cpp HitboxComponent.cpp Inventory.cpp Item.cpp MainMenuState.cpp MeleeWeapon.cpp MovementComponent.cpp PauseMenu.cpp Player.cpp PlayerGUI.cpp PlayerGUITabs.cpp RangedWeapon.cpp Rat.cpp RegularTile.cpp SettingsState.cpp SkillComponent.cpp State.cpp stdafx.cpp Sword.cpp Tab.cpp TextTagSystem.cpp Tile.cpp TileMap.cpp VectorMath.cpp Weapon.cpp -I"personalPath...\include" -DSFML_STATIC

link:
   g++ main.o AIComponent.o AIFollow.o AIOption.o AnimationComponent.o AttributeComponent.o Bird1.o Bow.o CharacterTab.o DefaultEditorMode.o EditorMode.o EditorState.o Enemy.o EnemyEditorMode.o EnemySpawnerTile.o EnemySystem.o Entity.o Game.o GameState.o GraphicsSettings.o Gui.o HitboxComponent.o Inventory.o Item.o MainMenuState.o MeleeWeapon.o MovementComponent.o PauseMenu.o Player.o PlayerGUI.o PlayerGUITabs.o RangedWeapon.o Rat.o RegularTile.o SettingsState.o SkillComponent.o State.o stdafx.o Sword.o Tab.o TextTagSystem.o Tile.o TileMap.o VectorMath.o Weapon.o -o jojo -L"personalPath...\lib" -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lsfml-audio-s -lsfml-network-s -lopengl32 -lfreetype -lwinmm -lgdi32 -lopenal32 -lflac -lvorbisenc -lvorbisfile -lvorbis -logg -lws2_32 -mwindows -lsfml-main


Again I am using this game (https://github.com/Headturna/SFML_RPG)
Well guess what? Got the same error (and 3 warnings)
The errors:
Quote
g++ main.o -o jojo -L"personal path...\lib" -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lsfml-audio-s
-lsfml-network-s -lopengl32 -lfreetype -lwinmm -lgdi32 -lopenal32 -lflac -lvorbisenc -lvorbisfile -lvorbis -logg -lws2_32 -mwindows -lsfml-main
main.o:main.cpp:(.text+0x1e): undefined reference to `Game::Game()'
main.o:main.cpp:(.text+0x2a): undefined reference to `Game::run()'
main.o:main.cpp:(.text+0x3b): undefined reference to `Game::~Game()'
main.o:main.cpp:(.text+0x4e): undefined reference to `Game::~Game()'
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [Makefile:7: link] Error 1

Since the make method is working, why am I not able to compile this video game?
(I tested with a simple green cercle prohect and everything worked fine, but not with this game? )


Edit: nevermind it worked
9
You mean I need to add all the cpp files in this list?
Yes

This seems to be the last version to use:
https://github.com/SFML/cmake-sfml-project/blob/master/CMakeLists.txt
So i need to replace this?  "${CMAKE_SOURCE_DIR}/cmake_modules"
But In my CMAKE installation there is NO FOLDER names "cmake_modules" As far as my searchs in C:\Program Files\CMake...

Same for the other pieces of this file I am not sure what to replace and with what.
Read the README file in the template repository, which should explain everything. ;)
10
You mean I need to add all the cpp files in this list?
g++ -c main.cpp -I"path..\include" -DSFML_STATIC

So that would be like this:
g++ -c main.cpp aifollow.cpp aiption.cpp ... -I"path..\include" -DSFML_STATIC ?

_
Second thing, I wanted to make a new post about it but it seems your answer partially repond to the post I wanted to make,
I wanted to use this project: https://github.com/johnBuffer/ZombieV
And I found a 'CMakeLists.txt.' fine and did not know what to do with it,

The file containts this:

Quote
cmake_minimum_required(VERSION 3.10)
set(PROJECT_NAME ZombieV)
project(${PROJECT_NAME} VERSION 1.0.0 LANGUAGES CXX)
find_package(OpenGL)

file(GLOB source_files
   "src/*.cpp"
   "src/Blur/*.cpp"
   "src/LightEngine/*.cpp"
   "src/Props/*.cpp"
   "src/System/*.cpp"
   "src/UnitedEngine/*.cpp"
   "src/Weapons/*.cpp"
)

set(SOURCES ${source_files})
set(CMAKE_CXX_STANDARD 11)

# Detect and add SFML
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
find_package(SFML 2 REQUIRED COMPONENTS audio graphics window system)

add_executable(${PROJECT_NAME} ${SOURCES})
target_include_directories(${PROJECT_NAME} PRIVATE "include" "lib")
target_link_libraries(${PROJECT_NAME} sfml-system sfml-window sfml-graphics sfml-audio)
if (UNIX)
   target_link_libraries(${PROJECT_NAME} pthread)
endif (UNIX)

# Copy data dir to the binary directory
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

if(MSVC)
   foreach(lib ${SFML_LIBS})
      get_target_property(lib_path ${lib} LOCATION)
      file(COPY ${lib_path} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
   endforeach()
endif(MSVC)

Tried this (cmake -S . -B build) and it did not work

This seems to be the last version to use:
https://github.com/SFML/cmake-sfml-project/blob/master/CMakeLists.txt
So i need to replace this?  "${CMAKE_SOURCE_DIR}/cmake_modules"
But In my CMAKE installation there is NO FOLDER names "cmake_modules" As far as my searchs in C:\Program Files\CMake...

Same for the other pieces of this file I am not sure what to replace and with what.
Pages: [1] 2 3 ... 10
anything