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

Pages: [1] 2 3 ... 6
1
SFML projects / Re: Fisynthesis - Crafting, Fishing Game
« on: June 06, 2015, 09:18:39 am »
Seems fun, is there a windows version?

2
General / Re: Flickering
« on: June 06, 2015, 05:31:33 am »
Nvm I found a solution.
I linked
Code: [Select]
sfml-main-d.lib
and changed
debug -> configeration properties -> linker -> system -> SubSystem to "Windows"

3
General / Re: Flickering
« on: June 06, 2015, 05:20:08 am »
My solution in Code::Blocks was to change the "Build Targets" setting, but I don't see that in VS2013.

4
General / Re: Flickering
« on: June 06, 2015, 05:10:55 am »
You should look at your project settings (if you are using an IDE).
Trying to find the setting in VS2013

5
General / Re: Flickering
« on: June 06, 2015, 05:02:24 am »
That's because the event is generated when the key is pressed, and every few milliseconds (depending on the configuration of your operating system). They do not occur in all frames. You should use a bool to maintain the state of the key.
Alright thank you. One more question, I forgot...How do you remove the console in the back of the window?

6
General / Flickering
« on: June 06, 2015, 04:43:37 am »
So I'm just getting back into SFML...This program is meant to display the message as I hold down the backspace button. But it's flickering badly, why is this?
Code: [Select]
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/Text.hpp>
#include <SFML/Graphics/Font.hpp>
#include <SFML/Window/Event.hpp>
int main()
{
sf::RenderWindow win(sf::VideoMode(500, 500), "Refresher", sf::Style::Default);
sf::Text wb;
sf::Font font;
font.loadFromFile("C:\\Windows\\Fonts\\Arial.ttf");
win.setVerticalSyncEnabled(true);
wb.setColor(sf::Color::Blue);
wb.setString("Welcome Back to SFML!");
wb.setCharacterSize(20);
wb.setStyle(sf::Text::Bold);
wb.setFont(font);
wb.setOrigin(wb.getLocalBounds().width / 2.0f, wb.getLocalBounds().height / 2.0f);
wb.setPosition(win.getSize().x / 2.0f, win.getSize().y / 2.0f);
while (win.isOpen())
{
sf::Event e;
win.clear();
while (win.pollEvent(e))
{
switch (e.type)
{
case sf::Event::Closed:
{
win.close();
}break;
case sf::Event::KeyPressed:
{
switch (e.key.code)
{
case sf::Keyboard::BackSpace:
{
win.draw(wb);
}break;
}
}break;
}
}
win.display();
}
return 0;
}

7
General / Re: Coding a text box
« on: December 14, 2014, 03:58:17 am »
Thank you I got it, thanks. :)

8
General / Coding a text box
« on: December 13, 2014, 08:34:09 am »
Hey everyone,
I'd love it if someone could help me develop a text box.
What i'm currently doing is using sf::isKeyPressed() and using sf::Clock. I append the key to a string every time a  key press is detected but not allow it to happen unless a certain amount of milliseconds has passed between the previous key press detection.
But things aren't working out as expected. Sometimes too many keys are pressed at once or sometimes none are detected at all. I need it to function like a normal keyboard.
I'm not doing this in my main class either i'm doing it in another class in the background while my normal event loop is running.

9
General / Re: Static Linking
« on: December 08, 2014, 04:00:42 am »
Alright, thank you all. I appreciate the help. :)

10
General / Re: Static Linking
« on: December 07, 2014, 08:18:50 pm »
If you had spend just 2min or maybe even just 1min searching the forum, you'd have come across this link.
I stumbled upon that already but didn't quite know what to do. I just figured it out though, thanks you helped.
Btw is there a way to add images to your program to load in a texture without distributing the actual image file with it?

11
General / Re: Static Linking
« on: December 07, 2014, 11:10:19 am »
I still get all this:
Code: [Select]
1>sfml-graphics-s-d.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol ___glewBlendEquation
1>sfml-graphics-s-d.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol ___glewActiveTextureARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewActiveTextureARB
1>sfml-graphics-s-d.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol ___glewClientActiveTextureARB
1>sfml-graphics-s-d.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol ___glewBlendEquationSeparateEXT
1>sfml-graphics-s-d.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol ___glewBlendFuncSeparateEXT
1>sfml-graphics-s-d.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol ___GLEW_ARB_multitexture
1>sfml-graphics-s-d.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol ___GLEW_EXT_blend_equation_separate
1>sfml-graphics-s-d.lib(RenderTarget.cpp.obj) : error LNK2001: unresolved external symbol ___GLEW_EXT_blend_func_separate
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewAttachObjectARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewCompileShaderARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewCreateProgramObjectARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewCreateShaderObjectARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewDeleteObjectARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewGetHandleARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewGetInfoLogARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewGetObjectParameterivARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewGetUniformLocationARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewLinkProgramARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewShaderSourceARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewUniform1fARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewUniform1iARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewUniform2fARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewUniform3fARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewUniform4fARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewUniformMatrix4fvARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___glewUseProgramObjectARB
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___GLEW_ARB_fragment_shader
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___GLEW_ARB_shader_objects
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___GLEW_ARB_shading_language_100
1>sfml-graphics-s-d.lib(Shader.cpp.obj) : error LNK2001: unresolved external symbol ___GLEW_ARB_vertex_shader
1>sfml-graphics-s-d.lib(Texture.cpp.obj) : error LNK2001: unresolved external symbol ___GLEW_ARB_texture_non_power_of_two
1>sfml-graphics-s-d.lib(GLExtensions.cpp.obj) : error LNK2019: unresolved external symbol _glewInit referenced in function "void __cdecl sf::priv::ensureExtensionsInit(void)" (?ensureExtensionsInit@priv@sf@@YAXXZ)
1>sfml-graphics-s-d.lib(GLExtensions.cpp.obj) : error LNK2019: unresolved external symbol _glewGetErrorString referenced in function "void __cdecl sf::priv::ensureExtensionsInit(void)" (?ensureExtensionsInit@priv@sf@@YAXXZ)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_std_error referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_CreateCompress referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_destroy_compress referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_stdio_dest referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_set_defaults referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_set_quality referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_start_compress referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_write_scanlines referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-graphics-s-d.lib(ImageLoader.cpp.obj) : error LNK2019: unresolved external symbol _jpeg_finish_compress referenced in function "private: bool __thiscall sf::priv::ImageLoader::writeJpg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<unsigned char,class std::allocator<unsigned char> > const &,unsigned int,unsigned int)" (?writeJpg@ImageLoader@priv@sf@@AAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$vector@EV?$allocator@E@std@@@5@II@Z)
1>sfml-window-s-d.lib(JoystickImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp__joyGetPosEx@8 referenced in function "public: static void __cdecl sf::priv::JoystickImpl::initialize(void)" (?initialize@JoystickImpl@priv@sf@@SAXXZ)
1>sfml-window-s-d.lib(JoystickImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp__joyGetDevCapsW@12 referenced in function "public: bool __thiscall sf::priv::JoystickImpl::open(unsigned int)" (?open@JoystickImpl@priv@sf@@QAE_NI@Z)
1>sfml-system-s-d.lib(SleepImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp__timeGetDevCaps@8 referenced in function "void __cdecl sf::priv::sleepImpl(class sf::Time)" (?sleepImpl@priv@sf@@YAXVTime@2@@Z)
1>sfml-system-s-d.lib(SleepImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp__timeBeginPeriod@4 referenced in function "void __cdecl sf::priv::sleepImpl(class sf::Time)" (?sleepImpl@priv@sf@@YAXVTime@2@@Z)
1>sfml-system-s-d.lib(SleepImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp__timeEndPeriod@4 referenced in function "void __cdecl sf::priv::sleepImpl(class sf::Time)" (?sleepImpl@priv@sf@@YAXVTime@2@@Z)

12
General / Static Linking
« on: December 07, 2014, 08:26:20 am »
I followed the full directions on the site after my normal procedure of linking the libraries.
I declared SFML_STATIC in preprocessors and then linked everything like sfml-graphics-s-d.lib[/url]
but It's giving me this:

I'm using a build of SFML from NightlyBuilds for Visual Studio 2013.
Everything works when I don't build it statically. This is my first static build.

13
General / Re: Bullet positioning (updated)
« on: December 07, 2014, 01:16:43 am »
I added:
Code: [Select]
const float PI = 3.14159265358979323846;And changed:
Code: [Select]
sh.setPosition(cos(rs.getRotation() * PI / 180) + rs.getPosition().x, sin(rs.getRotation() * PI / 180) + rs.getPosition().y + rs.getLocalBounds().height);But problem hasn't changed much.


14
General / Re: Bullet positioning
« on: December 06, 2014, 04:16:34 am »
I still don't quite understand it. Here's my code:
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Window/Event.hpp>
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/Graphics/CircleShape.hpp>
int main()
{
        sf::RenderWindow window(sf::VideoMode(800, 600), "Shooter");
        sf::CircleShape rs;
        sf::RectangleShape sh;
        rs.setRadius(50);
        sh.setSize(sf::Vector2f(5, 5));
        sh.setFillColor(sf::Color::Red);
        rs.setPosition(800.0 / 2, 600.0 / 2);
        rs.setOrigin(rs.getLocalBounds().width / 2.0f, rs.getLocalBounds().height / 2.0f);
        while (window.isOpen())
        {
                sf::Event e;
                window.clear(sf::Color::Black);
                while (window.pollEvent(e))
                {
                        switch (e.type)
                        {
                        case sf::Event::KeyPressed:
                        {
                                switch (e.key.code)
                                {
                                case sf::Keyboard::Left:
                                {
                                        rs.setRotation(rs.getRotation() - 1);
                                }break;
                                case sf::Keyboard::Right:
                                {
                                        rs.setRotation(rs.getRotation() + 1);
                                }
                                }
                        }break;
                        case sf::Event::Closed:
                        {
                                window.close();
                        }break;
                        }
                }
                sh.setPosition(cos(rs.getRotation()) + rs.getPosition().x, sin(rs.getRotation()) + rs.getLocalBounds().height + rs.getPosition().y);
                window.draw(rs);
                window.draw(sh);
                window.display();
        }
}
 
I'm trying to make the bullet rotate with the circle just to get a grip on the concept. But the bullet is just sitting there shaking when I rotate it.

15
General / Re: [SFML 2.1] No window created
« on: December 04, 2014, 01:12:04 am »
Do you have the required DLLs in the output folder?
And if you're compiling debug, did you include a "-d" at the end of the file names?

Pages: [1] 2 3 ... 6
anything