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.


Topics - cuddlyogre

Pages: [1]
1
DotNet / I've made a pull request on Github that I hope you'll consider.
« on: November 17, 2013, 08:32:48 am »
https://github.com/SFML/SFML.Net/pull/26

I've implemented Equals, GetHashCode, and Vector2.zero.

Equals allows you to check if one Vector2's value is the same as another's.
GetHashCode lets it be used in a dictionary effectively.
Zero returns a Vector2 with its X and Y set to 0.

I come from an XNA background, and I really missed the Vector2.Zero property since it is surprisingly helpful, most especially for uniform sprite movement.

I admittedly am not familiar with Git enough to know how to make a request for only the one request, so feel free to ignore the project related requests.

The intended commit is 1540bb0566f3b2e613b8c31c392b368351ddf2f4

2
I have downloaded, compiled, and successfully built SFML from the most recent GitHub source. Everything builds properly but when it comes time to link to my static libraries, no matter the settings I set, I cannot get my program to do so successfully. Neither Static Debug nor Static Release work, with x86 or x64.

Before you point me to the instructions, I have read them word for word.
http://sfml-dev.org/tutorials/2.1/compile-with-cmake.php
http://sfml-dev.org/tutorials/2.1/start-vc.php

If there is another source I missed, please share it. I am here to learn.

What puzzles me is that the dlls I build will link just fine. The static libs and dlls that come in the prepackaged SDK will link just fine. My method was to move the ones I built to another directory, then copy and paste the official ones in their place. There was zero issue with building my application after doing so. Moving everything back to their previous state restored the link errors. This leads me to be very confident that my game project is set up properly. There really just seems to be some kind of hitch in the build process for the static libs.

For this build, I am using the default settings in cmake (uncheck BUILD_SHARED_LIBS), but even using other settings, there was no change in behavior. The error messages lead me to think that there is a missing reference to openGL somewhere, but I have thus far been unable to tell where.

My code does not involve any calls to openGL. Just sf::Texture, sf:RenderWindow, and sf::Sprite, all SFML directly.

I am using Windows 8 with VS2012 Express. I used both cmake -P and the VS2012 INSTALL project to install everything, with no difference in outcome.

Build output is as follows:

Warning 1       warning D9035: option 'nologo-' has been deprecated and will be removed in a future release     E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\cl     SFMLTutorial
Warning 2       warning C4244: 'argument' : conversion from 'unsigned int' to 'float', possible loss of data    e:\projects\programming\github\sfmltutorial\sfmltutorial\ship.h 30      1       SFMLTutorial
Warning 3       warning C4244: 'argument' : conversion from 'unsigned int' to 'float', possible loss of data    e:\projects\programming\github\sfmltutorial\sfmltutorial\ship.h 30      1       SFMLTutorial
Warning 4       warning C4244: 'argument' : conversion from 'unsigned int' to 'float', possible loss of data    e:\projects\programming\github\sfmltutorial\sfmltutorial\ship.h 30      1       SFMLTutorial
Warning 5       warning C4244: 'argument' : conversion from 'unsigned int' to 'float', possible loss of data    e:\projects\programming\github\sfmltutorial\sfmltutorial\ship.h 30      1       SFMLTutorial
Error   6       error LNK2019: unresolved external symbol __imp__glBlendFunc@8 referenced in function "private: void __thiscall sf::RenderTarget::applyBlendMode(enum sf::BlendMode)" (?applyBlendMode@RenderTarget@sf@@AAEXW4BlendMode@2@@Z)   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   7       error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "public: void __thiscall sf::RenderTarget::clear(class sf::Color const &)" (?clear@RenderTarget@sf@@QAEXABVColor@2@@Z)        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   8       error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function "public: void __thiscall sf::RenderTarget::clear(class sf::Color const &)" (?clear@RenderTarget@sf@@QAEXABVColor@2@@Z)  E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   9       error LNK2019: unresolved external symbol __imp__glColorPointer@16 referenced in function "public: void __thiscall sf::RenderTarget::draw(class sf::Vertex const *,unsigned int,enum sf::PrimitiveType,class sf::RenderStates const &)" (?draw@RenderTarget@sf@@QAEXPBVVertex@2@IW4PrimitiveType@2@ABVRenderStates@2@@Z)        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   10      error LNK2019: unresolved external symbol __imp__glDisable@4 referenced in function "public: void __thiscall sf::RenderTarget::resetGLStates(void)" (?resetGLStates@RenderTarget@sf@@QAEXXZ)    E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   11      error LNK2019: unresolved external symbol __imp__glDrawArrays@12 referenced in function "public: void __thiscall sf::RenderTarget::draw(class sf::Vertex const *,unsigned int,enum sf::PrimitiveType,class sf::RenderStates const &)" (?draw@RenderTarget@sf@@QAEXPBVVertex@2@IW4PrimitiveType@2@ABVRenderStates@2@@Z)  E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   12      error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "public: void __thiscall sf::RenderTarget::resetGLStates(void)" (?resetGLStates@RenderTarget@sf@@QAEXXZ)     E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   13      error LNK2001: unresolved external symbol __imp__glEnable@4     E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-window-s-d.lib(GlContext.obj)     SFMLTutorial
Error   14      error LNK2019: unresolved external symbol __imp__glEnableClientState@4 referenced in function "public: void __thiscall sf::RenderTarget::resetGLStates(void)" (?resetGLStates@RenderTarget@sf@@QAEXXZ)  E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   15      error LNK2019: unresolved external symbol __imp__glGetError@0 referenced in function "public: void __thiscall sf::RenderTarget::pushGLStates(void)" (?pushGLStates@RenderTarget@sf@@QAEXXZ)     E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   16      error LNK2001: unresolved external symbol __imp__glGetError@0   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(GLCheck.obj)     SFMLTutorial
Error   17      error LNK2019: unresolved external symbol __imp__glLoadMatrixf@4 referenced in function "private: void __thiscall sf::RenderTarget::applyCurrentView(void)" (?applyCurrentView@RenderTarget@sf@@AAEXXZ) E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   18      error LNK2001: unresolved external symbol __imp__glLoadMatrixf@4        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Texture.obj)     SFMLTutorial
Error   19      error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "public: void __thiscall sf::RenderTarget::pushGLStates(void)" (?pushGLStates@RenderTarget@sf@@QAEXXZ)   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   20      error LNK2001: unresolved external symbol __imp__glMatrixMode@4 E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Texture.obj)     SFMLTutorial
Error   21      error LNK2019: unresolved external symbol __imp__glPolygonMode@8 referenced in function "public: void __thiscall sf::RenderTarget::resetGLStates(void)" (?resetGLStates@RenderTarget@sf@@QAEXXZ)        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   22      error LNK2019: unresolved external symbol __imp__glPopAttrib@0 referenced in function "public: void __thiscall sf::RenderTarget::popGLStates(void)" (?popGLStates@RenderTarget@sf@@QAEXXZ)      E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   23      error LNK2019: unresolved external symbol __imp__glPopClientAttrib@0 referenced in function "public: void __thiscall sf::RenderTarget::popGLStates(void)" (?popGLStates@RenderTarget@sf@@QAEXXZ)        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   24      error LNK2019: unresolved external symbol __imp__glPopMatrix@0 referenced in function "public: void __thiscall sf::RenderTarget::popGLStates(void)" (?popGLStates@RenderTarget@sf@@QAEXXZ)      E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   25      error LNK2019: unresolved external symbol __imp__glPushAttrib@4 referenced in function "public: void __thiscall sf::RenderTarget::pushGLStates(void)" (?pushGLStates@RenderTarget@sf@@QAEXXZ)   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   26      error LNK2019: unresolved external symbol __imp__glPushClientAttrib@4 referenced in function "public: void __thiscall sf::RenderTarget::pushGLStates(void)" (?pushGLStates@RenderTarget@sf@@QAEXXZ)     E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   27      error LNK2019: unresolved external symbol __imp__glPushMatrix@0 referenced in function "public: void __thiscall sf::RenderTarget::pushGLStates(void)" (?pushGLStates@RenderTarget@sf@@QAEXXZ)   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   28      error LNK2019: unresolved external symbol __imp__glTexCoordPointer@16 referenced in function "public: void __thiscall sf::RenderTarget::draw(class sf::Vertex const *,unsigned int,enum sf::PrimitiveType,class sf::RenderStates const &)" (?draw@RenderTarget@sf@@QAEXPBVVertex@2@IW4PrimitiveType@2@ABVRenderStates@2@@Z)     E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   29      error LNK2019: unresolved external symbol __imp__glVertexPointer@16 referenced in function "public: void __thiscall sf::RenderTarget::draw(class sf::Vertex const *,unsigned int,enum sf::PrimitiveType,class sf::RenderStates const &)" (?draw@RenderTarget@sf@@QAEXPBVVertex@2@IW4PrimitiveType@2@ABVRenderStates@2@@Z)       E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   30      error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function "private: void __thiscall sf::RenderTarget::applyCurrentView(void)" (?applyCurrentView@RenderTarget@sf@@AAEXXZ)   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   31      error LNK2001: unresolved external symbol ___glewBlendFuncSeparateEXT   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   32      error LNK2001: unresolved external symbol ___GLEW_EXT_blend_func_separate       E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderTarget.obj)        SFMLTutorial
Error   33      error LNK2019: unresolved external symbol __imp__glReadPixels@28 referenced in function "public: class sf::Image __thiscall sf::RenderWindow::capture(void)const " (?capture@RenderWindow@sf@@QBE?AVImage@2@XZ) E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(RenderWindow.obj)        SFMLTutorial
Error   34      error LNK2019: unresolved external symbol __imp__glBindTexture@8 referenced in function "public: bool __thiscall sf::Texture::create(unsigned int,unsigned int)" (?create@Texture@sf@@QAE_NII@Z)        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Texture.obj)     SFMLTutorial
Error   35      error LNK2001: unresolved external symbol __imp__glBindTexture@8        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(TextureSaver.obj)        SFMLTutorial
Error   36      error LNK2019: unresolved external symbol __imp__glCopyTexSubImage2D@32 referenced in function "public: void __thiscall sf::Texture::update(class sf::Window const &,unsigned int,unsigned int)" (?update@Texture@sf@@QAEXABVWindow@2@II@Z)     E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Texture.obj)     SFMLTutorial
Error   37      error LNK2019: unresolved external symbol __imp__glDeleteTextures@8 referenced in function "public: __thiscall sf::Texture::~Texture(void)" (??1Texture@sf@@QAE@XZ)     E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Texture.obj)     SFMLTutorial
Error   38      error LNK2019: unresolved external symbol __imp__glFlush@0 referenced in function "public: bool __thiscall sf::Texture::loadFromImage(class sf::Image const &,class sf::Rect<int> const &)" (?loadFromImage@Texture@sf@@QAE_NABVImage@2@ABV?$Rect@H@2@@Z)       E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Texture.obj)     SFMLTutorial
Error   39      error LNK2001: unresolved external symbol __imp__glFlush@0      E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   40      error LNK2019: unresolved external symbol __imp__glGenTextures@8 referenced in function "public: bool __thiscall sf::Texture::create(unsigned int,unsigned int)" (?create@Texture@sf@@QAE_NII@Z)        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Texture.obj)     SFMLTutorial
Error   41      error LNK2019: unresolved external symbol __imp__glGetIntegerv@8 referenced in function "public: static unsigned int __cdecl sf::Texture::getMaximumSize(void)" (?getMaximumSize@Texture@sf@@SAIXZ)     E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Texture.obj)     SFMLTutorial
Error   42      error LNK2001: unresolved external symbol __imp__glGetIntegerv@8        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   43      error LNK2001: unresolved external symbol __imp__glGetIntegerv@8        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(TextureSaver.obj)        SFMLTutorial
Error   44      error LNK2019: unresolved external symbol __imp__glGetTexImage@20 referenced in function "public: class sf::Image __thiscall sf::Texture::copyToImage(void)const " (?copyToImage@Texture@sf@@QBE?AVImage@2@XZ)  E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Texture.obj)     SFMLTutorial
Error   45      error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "public: static void __cdecl sf::Texture::bind(class sf::Texture const *,enum sf::Texture::CoordinateType)" (?bind@Texture@sf@@SAXPBV12@W4CoordinateType@12@@Z)        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Texture.obj)     SFMLTutorial
Error   46      error LNK2019: unresolved external symbol __imp__glTexImage2D@36 referenced in function "public: bool __thiscall sf::Texture::create(unsigned int,unsigned int)" (?create@Texture@sf@@QAE_NII@Z)        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Texture.obj)     SFMLTutorial
Error   47      error LNK2019: unresolved external symbol __imp__glTexParameteri@12 referenced in function "public: bool __thiscall sf::Texture::create(unsigned int,unsigned int)" (?create@Texture@sf@@QAE_NII@Z)     E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Texture.obj)     SFMLTutorial
Error   48      error LNK2019: unresolved external symbol __imp__glTexSubImage2D@36 referenced in function "public: bool __thiscall sf::Texture::loadFromImage(class sf::Image const &,class sf::Rect<int> const &)" (?loadFromImage@Texture@sf@@QAE_NABVImage@2@ABV?$Rect@H@2@@Z)      E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Texture.obj)     SFMLTutorial
Error   49      error LNK2001: unresolved external symbol ___GLEW_ARB_texture_non_power_of_two  E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Texture.obj)     SFMLTutorial
Error   50      error LNK2001: unresolved external symbol ___glewActiveTextureARB       E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   51      error LNK2001: unresolved external symbol ___glewAttachObjectARB        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   52      error LNK2001: unresolved external symbol ___glewCompileShaderARB       E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   53      error LNK2001: unresolved external symbol ___glewCreateProgramObjectARB E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   54      error LNK2001: unresolved external symbol ___glewCreateShaderObjectARB  E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   55      error LNK2001: unresolved external symbol ___glewDeleteObjectARB        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   56      error LNK2001: unresolved external symbol ___glewGetHandleARB   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   57      error LNK2001: unresolved external symbol ___glewGetInfoLogARB  E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   58      error LNK2001: unresolved external symbol ___glewGetObjectParameterivARB        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   59      error LNK2001: unresolved external symbol ___glewGetUniformLocationARB  E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   60      error LNK2001: unresolved external symbol ___glewLinkProgramARB E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   61      error LNK2001: unresolved external symbol ___glewShaderSourceARB        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   62      error LNK2001: unresolved external symbol ___glewUniform1fARB   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   63      error LNK2001: unresolved external symbol ___glewUniform1iARB   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   64      error LNK2001: unresolved external symbol ___glewUniform2fARB   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   65      error LNK2001: unresolved external symbol ___glewUniform3fARB   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   66      error LNK2001: unresolved external symbol ___glewUniform4fARB   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   67      error LNK2001: unresolved external symbol ___glewUniformMatrix4fvARB    E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   68      error LNK2001: unresolved external symbol ___glewUseProgramObjectARB    E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   69      error LNK2001: unresolved external symbol ___GLEW_ARB_fragment_shader   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   70      error LNK2001: unresolved external symbol ___GLEW_ARB_shader_objects    E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   71      error LNK2001: unresolved external symbol ___GLEW_ARB_shading_language_100      E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   72      error LNK2001: unresolved external symbol ___GLEW_ARB_vertex_shader     E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(Shader.obj)      SFMLTutorial
Error   73      error LNK2019: unresolved external symbol _glewInit referenced in function "void __cdecl sf::priv::ensureGlewInit(void)" (?ensureGlewInit@priv@sf@@YAXXZ)       E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(GLCheck.obj)     SFMLTutorial
Error   74      error LNK2019: unresolved external symbol _glewGetErrorString referenced in function "void __cdecl sf::priv::ensureGlewInit(void)" (?ensureGlewInit@priv@sf@@YAXXZ)     E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(GLCheck.obj)     SFMLTutorial
Error   75      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)     E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(ImageLoader.obj) SFMLTutorial
Error   76      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)        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(ImageLoader.obj) SFMLTutorial
Error   77      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)      E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(ImageLoader.obj) SFMLTutorial
Error   78      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)    E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(ImageLoader.obj) SFMLTutorial
Error   79      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)  E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(ImageLoader.obj) SFMLTutorial
Error   80      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)   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(ImageLoader.obj) SFMLTutorial
Error   81      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)        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(ImageLoader.obj) SFMLTutorial
Error   82      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)       E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(ImageLoader.obj) SFMLTutorial
Error   83      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)       E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-graphics-s-d.lib(ImageLoader.obj) SFMLTutorial
Error   84      error LNK2019: unresolved external symbol __imp__glGetString@4 referenced in function "private: void __thiscall sf::priv::GlContext::initialize(void)" (?initialize@GlContext@priv@sf@@AAEXXZ)  E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-window-s-d.lib(GlContext.obj)     SFMLTutorial
Error   85      error LNK2019: unresolved external symbol __imp__wglCreateContext@4 referenced in function "private: void __thiscall sf::priv::WglContext::createContext(class sf::priv::WglContext *,unsigned int,struct sf::ContextSettings const &)" (?createContext@WglContext@priv@sf@@AAEXPAV123@IABUContextSettings@3@@Z)        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-window-s-d.lib(WglContext.obj)    SFMLTutorial
Error   86      error LNK2019: unresolved external symbol __imp__wglDeleteContext@4 referenced in function "public: virtual __thiscall sf::priv::WglContext::~WglContext(void)" (??1WglContext@priv@sf@@UAE@XZ) E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-window-s-d.lib(WglContext.obj)    SFMLTutorial
Error   87      error LNK2019: unresolved external symbol __imp__wglGetCurrentContext@0 referenced in function "public: virtual __thiscall sf::priv::WglContext::~WglContext(void)" (??1WglContext@priv@sf@@UAE@XZ)     E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-window-s-d.lib(WglContext.obj)    SFMLTutorial
Error   88      error LNK2019: unresolved external symbol __imp__wglGetProcAddress@4 referenced in function "public: virtual void __thiscall sf::priv::WglContext::setVerticalSyncEnabled(bool)" (?setVerticalSyncEnabled@WglContext@priv@sf@@UAEX_N@Z) E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-window-s-d.lib(WglContext.obj)    SFMLTutorial
Error   89      error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function "public: virtual __thiscall sf::priv::WglContext::~WglContext(void)" (??1WglContext@priv@sf@@UAE@XZ)   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-window-s-d.lib(WglContext.obj)    SFMLTutorial
Error   90      error LNK2019: unresolved external symbol __imp__wglShareLists@8 referenced in function "private: void __thiscall sf::priv::WglContext::createContext(class sf::priv::WglContext *,unsigned int,struct sf::ContextSettings const &)" (?createContext@WglContext@priv@sf@@AAEXPAV123@IABUContextSettings@3@@Z)   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-window-s-d.lib(WglContext.obj)    SFMLTutorial
Error   91      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)  E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-window-s-d.lib(JoystickImpl.obj)  SFMLTutorial
Error   92      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)   E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-window-s-d.lib(JoystickImpl.obj)  SFMLTutorial
Error   93      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) E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-system-s-d.lib(SleepImpl.obj)     SFMLTutorial
Error   94      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)        E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-system-s-d.lib(SleepImpl.obj)     SFMLTutorial
Error   95      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)  E:\Projects\Programming\GitHub\SFMLTutorial\SFMLTutorial\sfml-system-s-d.lib(SleepImpl.obj)     SFMLTutorial
Error   96      error LNK1120: 82 unresolved externals  E:\Projects\Programming\GitHub\SFMLTutorial\Debug - Static\SFMLTutorial.exe     SFMLTutorial
 

3
Graphics / I need fresh eyes to look at my game loops
« on: November 05, 2013, 04:30:09 pm »
I have three loops. One is of my own design and runs just like I want it to, but from what I am reading, is the wrong way to do things. I have two others from Dewitter's tutorial and the Fix Your Timestep article, that almost work, but I am certain I am missing something to bring it home.

I would love if someone took a look at my project and tell me what I am doing wrong.

The below code should compile without issue and without need of outside resources. Just copy and paste it. It will first launch a window with my gameloop. When you close that window, my take on Dewitter's loop will launch, and finally the FYT loop.

#include <SFML\Graphics.hpp>

void startMinimalExample();
void startDeWitters();
void startGafferonGames();

int main()
{
        startMinimalExample();
        startDeWitters();
        startGafferonGames();
        return 0;
}

//I cannot see a fault with this but apparently it is bad practice.
void startMinimalExample()
{
        sf::RenderWindow window;
        window.create(sf::VideoMode(640, 480),"SFML Window");
        window.setActive(false);
        sf::Event event;
        sf::RectangleShape sprite(sf::Vector2f(300, 300));
        sprite.setFillColor(sf::Color::Blue);
        float speed = 150.0f;

        sf::Clock updateClock;
        float updatesPerSecond = 1.0f / 30.0f;
        sf::Time timeSinceLastUpdate;

        sf::Clock drawClock;
        float drawsPerSecond = 1.0f / 60.0f;
        sf::Time timeSinceLastDraw;

        while (window.isOpen())
        {
                if (updateClock.getElapsedTime().asSeconds() > updatesPerSecond)
                {
                        timeSinceLastUpdate = updateClock.restart();
                        while (window.pollEvent(event))
                        {
                                if (event.type == sf::Event::Closed)
                                {
                                        window.close();
                                }
                        }

                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::D))
                        {
                                sprite.move(speed * timeSinceLastUpdate.asSeconds(), 0);
                        }

                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::A))
                        {
                                sprite.move(-speed * timeSinceLastUpdate.asSeconds(), 0);
                        }
                }

                if (drawClock.getElapsedTime().asSeconds() > drawsPerSecond)
                {
                        timeSinceLastDraw = drawClock.restart();
                        window.clear();
                        window.draw(sprite);
                        window.display();
                }
        }
}

//High framerate and good speed consistency only if TICKS PER SECOND stays at a fairly low value
void startDeWitters()
{
        sf::RenderWindow window;
        window.create(sf::VideoMode(640, 480),"SFML Window");
        window.setActive(false);
        sf::Event event;
        sf::RectangleShape sprite(sf::Vector2f(300, 300));
        sprite.setFillColor(sf::Color::Blue);
        float speed = 10.0f;

        sf::Clock clock;

        const int TICKS_PER_SECOND = 25;
        const int SKIP_TICKS = 1000 / TICKS_PER_SECOND;
        const int MAX_FRAMESKIP = 5;

        sf::Int64 next_game_tick = clock.getElapsedTime().asMilliseconds();
        int loops;
        float interpolation;

        while (window.isOpen())
        {
                loops = 0;

                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                        {
                                window.close();
                        }
                }

                while (clock.getElapsedTime().asMilliseconds() > next_game_tick && loops < MAX_FRAMESKIP)
                {
                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::D))
                        {
                                sprite.move(speed, 0);
                        }

                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::A))
                        {
                                sprite.move(-speed, 0);
                        }

                        next_game_tick += SKIP_TICKS;
                        loops++;
                }

                //AM I MISSING SOMETHING HERE?
                interpolation = float(clock.getElapsedTime().asMilliseconds() + SKIP_TICKS - next_game_tick) / float(SKIP_TICKS);

                window.clear();
                window.draw(sprite);
                window.display();
        }
}

//High framerate but poor speed consistency
void startGafferonGames()
{
        sf::RenderWindow window;
        window.create(sf::VideoMode(640, 480),"SFML Window");
        window.setActive(false);
        sf::Event event;
        sf::RectangleShape sprite(sf::Vector2f(300, 300));
        sprite.setFillColor(sf::Color::Blue);
        float speed = .25f;

        double t = 0.0;
        const double dt = 0.01;

        sf::Clock clock;
        sf::Int32 currentTime = clock.getElapsedTime().asMilliseconds();
        double accumulator = 0.0;

        while (window.isOpen())
        {
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                        {
                                window.close();
                        }
                }

                sf::Int32 newTime = clock.getElapsedTime().asMilliseconds();
                double frameTime = newTime - currentTime;
                if (frameTime > 0.25)
                {
                        frameTime = 0.025;
                }

                currentTime = newTime;
                accumulator += frameTime;

                while (accumulator >= dt)
                {
                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::D))
                        {
                                sprite.move(speed, 0);
                        }

                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::A))
                        {
                                sprite.move(-speed, 0);
                        }

                        t += dt;
                        accumulator -= dt;
                }

                //AM I MISSING SOMETHING HERE?
                const double alpha = accumulator / dt;

                window.clear();
                window.draw(sprite);
                window.display();
        }
}
 

4
System / Assistance requested concerning render threads.
« on: November 04, 2013, 05:26:14 pm »
I am attempting to separate out my rendering from my logic.

As it is, when I render inside of my update thread, everything is incredibly smoothly. But when I move the draw operations to their own thread, everything gets incredibly choppy.

I've done a lot of researching and apparently this is a common issue with just about any framework in existence, but I can't seem to find any real answers on how to remedy the situation, besides just not separating them in the first place.

If that's what I have to do, then I accept that, but it would be nice to be able to do this, if even just to know how. If the answer is in the documentation, or on the forums somewhere, please direct me to it. I would love to read it.

CODE IS AS FOLLOWS

#include <SFML\Graphics.hpp>
#include <SFML\System.hpp>
#include <functional>

void startGameClass();
void startMinimalExample();
void render(sf::Sprite *sprite);
sf::RenderWindow window;

int main()
{
        startMinimalExample();
        return 0;
}

void startMinimalExample()
{
        window.create(sf::VideoMode(640, 480),"SFML Window");
        window.setActive(false);

        sf::Sprite sprite;
        sf::Texture texture;
        texture.loadFromFile(".\\resources\\test.png");
        sprite.setTexture(texture);

        sf::Thread t(std::bind(&render, &sprite));

        //UNCOMMENT t.launch() TO LAUNCH RENDER THREAD
        //COMMENT OUT WINDOW CALLS BELOW AS WELL
        //t.launch();

        sf::Clock updateClock;
        float fps = 1000000.00f / 60.00f;
        while (window.isOpen())
        {
                if (updateClock.getElapsedTime().asMicroseconds() >= fps)
                {
                        sf::Time elapsed = updateClock.restart();

                        sf::Event event;
                        while (window.pollEvent(event))
                        {
                                if (event.type == sf::Event::Closed)
                                {
                                        window.close();
                                }
                        }

                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::D))
                        {
                                sprite.move(.25f * elapsed.asMilliseconds(), 0);
                        }

                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::A))
                        {
                                sprite.move(-.25f * elapsed.asMilliseconds(), 0);
                        }

                        //COMMENT NEXT THREE LINES WHEN USING RENDER THREAD
                        window.clear();
                        window.draw(sprite);
                        window.display();      
                }
        }
}

void render(sf::Sprite *sprite)
{
        sf::Clock renderclock;
        float fps = 1000000.00f / 60.00f;
        while (window.isOpen())
        {
                if (renderclock.getElapsedTime().asMicroseconds() >= fps)
                {
                        renderclock.restart();
                        window.clear(sf::Color::Black);
                        window.draw(*sprite);
                        window.display();
                }
        }
}
 

Pages: [1]
anything