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

Pages: [1]
1
C / Why can't CMAKE find my SFML libraries in CLion?
« on: June 12, 2016, 01:07:40 pm »
Hey, I'm trying to use CLion with SFML, which means I have to use CMake. This is my CMakeLists.txt file:
cmake_minimum_required(VERSION 2.6)

if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
endif()

project(Polymorphism)

set(SOURCE_FILES main.cpp)
add_executable(Polymorphism ${SOURCE_FILES})

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Modules" ${CMAKE_MODULE_PATH})
find_package(SFML REQUIRED system window graphics network audio)
if(SFML_FOUND)
    include_directories(${SFML_INCLUDE_DIR})
    target_link_libraries(${main.cpp} ${SFML_LIBRARIES})
endif()

 
This is the error I am getting:
Error:Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY SFML_GRAPHICS_LIBRARY SFML_NETWORK_LIBRARY SFML_AUDIO_LIBRARY)

Any help would be appreciated.

2
General / Re: Dedicating a class to drawing
« on: December 07, 2013, 01:02:15 pm »
Wow, thanks - didn't think it was such a silly mistake!  :)

3
General / Dedicating a class to drawing [SOLVED]
« on: December 07, 2013, 12:03:21 am »
I am trying to make a class ("render") that will handle all drawing within my program, so that if I had a sprite I wanted to draw I would send it to a function such as:
void draw(sf::Sprite);

Now so far it is working but I have run into trouble whether or not to declare the main RenderWindow in this class, e.g:
private:
sf::RenderWindow window(sf::VideoMode(800, 800), "A Game That Loves You!");
With this I would only be able to access it within this class but also make an accessory function to access it outside. Now here is my issue:

I have a couple of errors, one of them has this error message:
..\..\..\Assets\SFML-2.1\include\SFML\System\NonCopyable.hpp|67|error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private|

and the other error is:
F:\Programming\C++ SFML\SFML Development\render.cpp|16|note: synthesized method 'sf::RenderWindow::RenderWindow(const sf::RenderWindow&)' first required here |



This is the overall code I have at the moment:
render.h:
#ifndef RENDER_H
#define RENDER_H
#include <SFML/Graphics.hpp>


class render
{
    public:
        render();
        void draw(sf::Sprite);
        sf::RenderWindow getWindow();
    protected:
    private:

        sf::RenderWindow window;
};

#endif // RENDER_H
 

render.cpp:
#include "render.h"
#include <SFML/Graphics.hpp>
#include <iostream>

render::render()
{
    sf::RenderWindow window(sf::VideoMode(800, 800), "A Game That Loves You!");
}

void render::draw(sf::Sprite sprite)
{
    //empty!
}

sf::RenderWindow render::getWindow()
{
    return window;
}
 



If anyone could explain or give a solution to these errors I would be very grateful, thanks. (:

Pages: [1]