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

Pages: 1 [2]
16
General / Re: how to select SFML version to match CodeBlocks version
« on: November 22, 2021, 05:49:09 pm »
thank you. Version returened:
gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0

how should I act upon this?

17
General / Re: how to select SFML version to match CodeBlocks version
« on: November 22, 2021, 05:02:48 pm »
Is windows-gcc-810-mingw-64.zip a SFML version not listed on the SFML download page?
Also in which console I run  gcc --version? If you mean Windows command prompt - it returnes "Non executable"

18
General / Re: how to select SFML version to match CodeBlocks version
« on: November 22, 2021, 04:11:35 pm »
Thank you for being positive. As I said, I would like to exclude the possibility of after 10 successful projects the 11th project would fail and I'll have not only to re-install SFML, but also to correct those 10 successfull projects.

I installed CodeBlocks and successfuly  tested it on C++ Hellow Word.

I downloaded GCC 7.3.0 MinGW (DW2)-32-bit  and  SFML-2.5.1-windows-gcc-7.3.0-mingw-64-bit.zip but do not proceed with installation till I know which version to install.  Try-and-see method is the only one if you explore something unknown. But to stage experiments to learn something known to those who are in this business seems to be unreasonable. Before inventing the wheel it pays to ask if it has already been invented!

If we have just two SFML versions to select from and one version of CodeBlocks, where in the CodeBlocks I should look at to see which SFML version suits it? 

19
General / Re: how to select SFML version to match CodeBlocks version
« on: November 22, 2021, 02:49:55 pm »
Thanks a lot for your time. Also mind that English is not my mother tongue, threfore I might mis-interpret your comments.

1. As I said, I am basing my conclusions on  instructions (https://www.sfml-dev.org/tutorials/2.5/start-cb.php)
These instructions only instruct to downlowas SFML matching CodeBlocks. It says nothing about  artifacts linked above (what exactly  are the "artifacts above"?).
 
2. The instructions say nothing about changing compiler. As a complete newby to SFML and CodeBlock I just need to make a working set up to start coding in C++; During installation I selected GNU GCC compiler and then C++; Therefore at this stage I do not know why I should consider to change compiler or not

3. "If you have a compiler with SEH exception mode" - how shall I know if I  have a compiler with or without SEH exception mode?

Before posting my question I browsed through the questions people are asking. Many questions deal with the code refused to compile of some files are not found - probably the reason for that is wrong version of SFML and wrong setup. Therefore explanation in layman terms is of importance
 


20
General / Re: how to select SFML version to match CodeBlocks version
« on: November 22, 2021, 11:48:01 am »
Thanks. I know that if you want something to be done correctly, do it yourself. Yet this works only when you are professional in that craft.
Do you mean that for my Win-10 64 bit and CodeBlocks 20.03 I need GCC 7.3.0 MinGW (SEH) - 64-bit ?

21
General / how to select SFML version to match CodeBlocks version
« on: November 22, 2021, 10:59:42 am »
The SFML set up instructions (https://www.sfml-dev.org/tutorials/2.5/start-cb.php) stresses the importance of correct selection of SFML version to match that of CodeBlocks, but does not offer clear guidince for that.

Indeed the last thing we want is the setup will start failing on certain projects because of non-compatibility of SFML and CodBlocks versions.
 
On https://youtu.be/8aQdx40KeHw?t=45  a Russian chap sugests that the correct version of SFML should match two dll files in Program Files\CodeBlocks\MinGW\bin:

libgcc_s_dw2-1.dll
libgcc_s_sjlj-1.dll

If you have just libgcc_s_dw2-1.dll than download DW2 version
If you also have libgcc_s_sjlj-1.dll then doen load SJLJ version

Is this correct?
If it is, will also be correct to download the SEH version if I donot have libgcc_s_dw2-1.dll or libgcc_s_sjlj-1.dll, but have  libgcc_s_seh-1.dll (I have CodeBlocks version 20.03

22
General / Re: Event handling
« on: October 01, 2019, 09:10:20 pm »
Thank you, Arcade,
Compiled with
if (event.type == sf::Event::MouseButtonPressed)
instead of
if (sf::Mouse::isButtonPressed(sf::Mouse::Left)) as you suggested

Same story unfortunatelly. Still good to learn an alrternative way to handle this mouse event

PS. searching about sf::Event::MouseButtonPressed came across a relevant topic titled
 Mouse::isButtonPressed(Mouse::Left) vs (event.mouseButton.button == Mouse::Left) here:
https://en.sfml-dev.org/forums/index.php?topic=21084.0

Tried
if(event.mouseButton.button == sf::Mouse::Left)
it worked!

Read that topic twice as well as two relevant articles referred to there:
Events explained
www.sfml-dev.org/tutorials/2.4/window-events.php
Keyboard, mouse and joystick
www.sfml-dev.org/tutorials/2.4/window-inputs.php

and still not sure if I understand why it worked while
if (event.type == sf::Event::MouseButtonPressed)
and
if (sf::Mouse::isButtonPressed(sf::Mouse::Left)) 
did not.

I obviously lack some fundamental understanding of C++ and SFML. While I am trying to get it, perhaps someone can explain me in layman terms what causes that big difference between those event handlings and why this difference shows itself on Windows-10 and is ignored by Windows XP, 7 and 8 ?

23
General / Event handling
« on: September 30, 2019, 08:25:26 pm »
Using CodeBlock compiled the following code to test the idea:  on mouse Click move a red dot to the cursor:
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(1024, 768), "Test");
    sf::RectangleShape bullet(sf::Vector2f(5.0f, 5.0f));
    bullet.setFillColor(sf::Color::Red);

    while (window.isOpen())
    {
       sf::Event event;
       while (window.pollEvent(event))
       {
            if (event.type == sf::Event::Closed)
                window.close();
       }
        if (sf::Mouse::isButtonPressed(sf::Mouse::Left))
        {
            sf::Vector2i mousePos = sf::Mouse::getPosition(window);
            bullet.setPosition((float) mousePos.x, (float)mousePos.y);
        }
        window.clear();
        window.draw(bullet);
        window.display();
    }
    return 0;
}

It works fine with the mouse on Win XP, 7, 8 and 10.

However the final objective is to make a program which could be controlled on a big screen with a laser pointer. To this end a web camera is used for which a program is written in C# using NET Framework 4.5. This program receives frames from the webcam, locates a laser dot and emulates mouse click event.

On Windows XP, 7 and 8  this works fine. However on Win 10 it does not. It moves the cursor to the laser dot, yet does not move the red dot as if the mouse click event does not come through.

Other standard Windows applications like Paint or Windows Explorer react to the laser beam properly therefore the problem seems to be in misunderstanding between my SFML code and Windows-10.

What could be wrong?

24
General / LNK2019 unresolved external symbol....
« on: September 30, 2019, 04:52:12 pm »
Hi, colleagues,
Four year ago there was a thread here  "Unresolved External Symbol" (https://en.sfml-dev.org/forums/index.php?topic=14715.0) which remains unresolved.

Trying to set up Visual Studio 2015 to work with SFML I run into  similar problem

In my 64 bit  Win 7 ultimate SP 1 I have: 

Visual Studio Community 2015   Version 14.0.25431.01 update 3.
It does not say if it is 86 or 64 but was installed from
en_visual_studio_community_2015_with_update_3_x86_x64_web_installer_8922963.exe
and says that it includes Visual C++ 2015 00322 20000 00000 AA787

SFML 2.5.1 for  Visual C++ 14 (2015) - 64-bit   downloaded from  www.sfml-dev.org/download/sfml/2.5.1/

I did and checked twice all the settings for the static version as prescribed at www.sfml-dev.org/tutorials/2.5/start-vc.php
I set Debug and Release for x64

Yet the sample code shown at www.sfml-dev.org/tutorials/2.5/start-vc.php  returns a bunch of errors "LNK2019 unresolved external symbol....." all referring to the first line of the code which is
#include <SFML/Graphics.hpp> 
and blaming symbols like gkBlendFunc, glClearColor etc from files sfml-graphics-s-d.lib, sfml-window-s-d.lib and sfml-system-s-d.lib,

Obviously VS finds and opens necessary libraries yet does not understand them.

In that old thread mentioned one of the suspects was C++ compiler which in VS10 was 32bit

How shall I find out if C++ compiler  in my  VS-2015 is 32 or 64?
if it is 64 what could be other possible reasons for errors?
Do I have incompatible version of VS and SFML? Or my setting in VS are wrong?

25
General / Re: attchaching on object to another as a child on mouseClick
« on: September 30, 2019, 04:46:29 pm »
Thank you. As I never used game engine and my experience is limited by doing some simple games in Flash, I have no idea of what "object/entity management" means in this context.  I guess it allows creating visible objects, placing them on the screen and making them move?
I know event handling in Flash. Saying "don't get event handling on entity-level"  do you mean that in SFML there is no built-in facility to handle, for example, a mouse click on a particular object?   

26
General / attchaching on object to another as a child on mouseClick
« on: September 27, 2019, 05:57:10 pm »
I  need to make a shooting simulator similar to this one made in Flash: http://igroflot.ru/shot/flash_game_50/

When mouse is pressed a bullet hole is placed on the target at the coursor coordinates. I guess these a local target coordinates and the bullet hole object becomes a child of the target object so that if the target moves or scales, the hole moves and scales with the target.

Also the points score is returned and its value depends on the hit zone of the target.
In Flash this is done by assembling the target of concentric circles each beeing a sepatate object with its points value and listening for onPress event (mouse click) which calls a function placing the bullet hole and returning the points.
In Flash when several objects, listening onPress event are placed one on top another, only the upper one reacts and stops event from propagating downwards.

I am trying to select a right tool to repeat this without Flash.
Can this approch be implemented in  C++ and SFML? I have SFML installed as well as Code Blocks C++ and Viasual Studio,  I looked through a number of tutorials, but still not sure if C++& SFML would be the right choice.

A founded opinion will be appreciated

Pages: 1 [2]