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

Pages: [1]
1
General discussions / SFML media demo - Linking error on windows 10
« on: April 28, 2018, 05:41:17 pm »
 I tried with the sfml media demo code (https://www.sfml-dev.org/documentation/2.4.2/). I can build and run with CLion on mac os x. However, I am having the following linking error on windows 10 with CLion. I wonder whether I need extra setup on windows 10. By the way, I don't have any D: drive. I installed SFML to C:\SFML.

C:/SFML/lib/libsfml-window-s-d.a(Window.cpp.obj): In function `ZN2sf6WindowC2Ev':
D:/sfml-release/_Sources/SFML/src/SFML/Window/Window.cpp:48: undefined reference to `sf::Clock::Clock()'
D:/sfml-release/_Sources/SFML/src/SFML/Window/Window.cpp:48: undefined reference to `sf::Time::Zero'
D:/sfml-release/_Sources/SFML/src/SFML/Window/Window.cpp:48: undefined reference to `sf::Time::Zero'
C:/SFML/lib/libsfml-window-s-d.a(Window.cpp.obj): In function `ZN2sf6WindowC2ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE':
D:/sfml-release/_Sources/SFML/src/SFML/Window/Window.cpp:59: undefined reference to `sf::Clock::Clock()'
....

2
Graphics / sf::RectangleShape
« on: April 27, 2018, 01:36:10 am »
I wonder whether it is possible to set the top,left,right, and bottom outline with the different colors.


3
General / Re: how to create a grid?
« on: April 25, 2018, 09:56:06 pm »
I am trying to do the similar task by creating the Grid class. Basically, I am trying to create 2D sf::RectangleShape arrays. The following is the snippet of the code.  However, when I try to draw by looping through each element in Rects[][], it doesn't show any. Can anyone advise the mistake(s) that I made?

Thanks!!


#include <SFML/Graphics.hpp>

class Grid {
private:
    sf::RectangleShape** Rects;
    sf::RenderWindow *gridWindow;
    int row;
    int col;
public:
    Grid() {
    }
    Grid(int r, int c, sf::RenderWindow *window): row(r), col(c), gridWindow(window) {
        int w = gridWindow->getSize().x * 1.0 / row;
        int h = gridWindow->getSize().y * 1.0 / col;

        Rects = new sf::RectangleShape*[r];
        for (int i = 0; i < row; i++)
            Rects = new sf::RectangleShape[col];

        // need to create an actual cell
        int baseX = 100;
        int baseY = 100;

        for (int i = 0; i < row; i++) {
            for (int j = 0; j < col; j++) {
                Rects[j] = sf::RectangleShape();
                Rects[j].setPosition(baseX, baseY);
                Rects[j].setFillColor(sf::Color::Yellow);
                Rects[j].setOutlineColor(sf::Color::White);
                Rects[j].setOutlineThickness(10);
                baseX += w;
            }
            baseX = 10;
            baseY += h;
        }
    }

4
General / help : SFML_2_4_2_osx_clang build error on macOS High Sierra
« on: April 19, 2018, 04:33:29 pm »
I downloaded the SFML_2_4_2_osx_clang from https://www.sfml-dev.org/download/sfml/2.4.2/.

Inside the project source directory, I created build subdirectory.

cd build
cmake ../.       (attachment: cake-log.txt)
make              (attachment: make-log.txt)

The following is the snippet of the make error. It appears that I need to properly set CMakeLIsts.txt for OpenGL library ?? Any help will be appreciated.

....
 "_glMatrixMode", referenced from:
      _main in OpenGL.cpp.o
      _main in Window.cpp.o
  "_glRotatef", referenced from:
      _main in OpenGL.cpp.o
      _main in Window.cpp.o
  "_glTexCoordPointer", referenced from:
      _main in OpenGL.cpp.o
  "_glTranslatef", referenced from:
      _main in OpenGL.cpp.o
      _main in Window.cpp.o
  "_glVertexPointer", referenced from:
      _main in OpenGL.cpp.o
      _main in Window.cpp.o
  "_glViewport", referenced from:
      _main in OpenGL.cpp.o
      _main in Window.cpp.o
  "_objc_msgSend", referenced from:
      resourcePath() in ResourcePath.mm.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

5
General discussions / SFML_2_4_2_osx_clang
« on: April 19, 2018, 01:39:11 am »
I am trying to build SFML from the SFML_2_4_2_osx_clang project source and I am having a build error on macOS High Sierra 10.13.4.

(1) First, I created a directory 'build'
(2) cd build
(3) cmake ..
(4) make

I am attaching 2 log files for your info - one is for cmake and the other is for make. Thank you for your help in advance.

Pages: [1]