Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML Light System - Let There Be Light  (Read 230251 times)

0 Members and 1 Guest are viewing this topic.

Ockonal

  • Jr. Member
  • **
  • Posts: 58
    • ICQ Messenger - 449909010
    • View Profile
    • WinCode
SFML Light System - Let There Be Light
« Reply #45 on: March 03, 2012, 07:24:00 am »
lolz123, great job! I gonna look at sources in a few hours and make some changes if they are needed. Gonna write here about any changes.

Thanks again.
Developing 2d engine&game using: sfml, box2d, librocket, spark2, zoom&zoost, thor

Roose Bolton of the Dreadfort

  • Full Member
  • ***
  • Posts: 113
  • Full-time Procrastinator, Part-time programmer.
    • View Profile
    • Personal Portfolio/Website/Blog
SFML Light System - Let There Be Light
« Reply #46 on: March 06, 2012, 07:38:46 pm »
Right I am getting to my wits end here..

Can anyone please explain how to link this into a project?

I want to play around with it so much it looks amazing!!

I have included SFML2.0 that works fine.. i downloaded GLEW of their website and linked it to my project correctly (or i think) and i get these errors when I try to compile ur main that you gave us with ur example code

Code: [Select]
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ltbl::LightSystem::~LightSystem(void)" (??1LightSystem@ltbl@@QAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ltbl::LightSystem::RenderLightTexture(float)" (?RenderLightTexture@LightSystem@ltbl@@QAEXM@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ltbl::LightSystem::RenderLights(void)" (?RenderLights@LightSystem@ltbl@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ltbl::Light::SetCenter(class ltbl::Vec2f)" (?SetCenter@Light@ltbl@@QAEXVVec2f@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ltbl::LightSystem::AddConvexHull(class ltbl::ConvexHull *)" (?AddConvexHull@LightSystem@ltbl@@QAEXPAVConvexHull@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ltbl::ConvexHull::SetWorldCenter(class ltbl::Vec2f const &)" (?SetWorldCenter@ConvexHull@ltbl@@QAEXABVVec2f@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ltbl::ConvexHull::GenerateAABB(void)" (?GenerateAABB@ConvexHull@ltbl@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ltbl::ConvexHull::CalculateNormals(void)" (?CalculateNormals@ConvexHull@ltbl@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall ltbl::ConvexHull::LoadShape(char const *)" (?LoadShape@ConvexHull@ltbl@@QAE_NPBD@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ltbl::ConvexHull::ConvexHull(void)" (??0ConvexHull@ltbl@@QAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ltbl::LightSystem::AddLight(class ltbl::Light *)" (?AddLight@LightSystem@ltbl@@QAEXPAVLight@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ltbl::Light::Light(void)" (??0Light@ltbl@@QAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ltbl::LightSystem::LightSystem(class ltbl::AABB const &,class sf::RenderWindow *)" (??0LightSystem@ltbl@@QAE@ABVAABB@1@PAVRenderWindow@sf@@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ltbl::AABB::AABB(class ltbl::Vec2f const &,class ltbl::Vec2f const &)" (??0AABB@ltbl@@QAE@ABVVec2f@1@0@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ltbl::Vec2f::Vec2f(float,float)" (??0Vec2f@ltbl@@QAE@MM@Z) referenced in function _main


I am losing faith in life at the moment can anyone help me or send me over a example project with it all linked correctly?

sorry guys..

matthew.
Trying so very hard to finish at-least one project.

Watch out for the RAII police, they will get you.

www.bantersaurus-games.com

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
SFML Light System - Let There Be Light
« Reply #47 on: March 06, 2012, 10:25:49 pm »
Did you link to the .cpp's?
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

Roose Bolton of the Dreadfort

  • Full Member
  • ***
  • Posts: 113
  • Full-time Procrastinator, Part-time programmer.
    • View Profile
    • Personal Portfolio/Website/Blog
SFML Light System - Let There Be Light
« Reply #48 on: March 06, 2012, 11:01:26 pm »
Yeah they are all linked. still getting unresolved external errors. ;/
Trying so very hard to finish at-least one project.

Watch out for the RAII police, they will get you.

www.bantersaurus-games.com

Roose Bolton of the Dreadfort

  • Full Member
  • ***
  • Posts: 113
  • Full-time Procrastinator, Part-time programmer.
    • View Profile
    • Personal Portfolio/Website/Blog
SFML Light System - Let There Be Light
« Reply #49 on: March 06, 2012, 11:19:39 pm »
Could you link me to the extact download link for glew?
Trying so very hard to finish at-least one project.

Watch out for the RAII police, they will get you.

www.bantersaurus-games.com

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
SFML Light System - Let There Be Light
« Reply #50 on: March 07, 2012, 12:50:03 am »
That shouldn't be the problem. I would either try adding the source directly to your project, or go into the files and change the "" in the #include statements to <>. I believe the problem may be that the #includes are not using the linker.
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

Roose Bolton of the Dreadfort

  • Full Member
  • ***
  • Posts: 113
  • Full-time Procrastinator, Part-time programmer.
    • View Profile
    • Personal Portfolio/Website/Blog
SFML Light System - Let There Be Light
« Reply #51 on: March 08, 2012, 07:27:47 pm »
hmm I tried that to no success.

Basically I am >

Installing fresh SFML2.0 on my project, run test code all compiles and runs the window fine with blue colour.

Add your light addon to the project, attach it to my project and include it, I type  ltbl:: to make sure its linked as all the functions pop up.
 
Download Glew 1.7.0 (NewestVersion) and put it in C:\

go to my Project Properties > Include Directories and add
C:\glew\include

then in library directories add  
C:\glew\lib

then go to additional dependencies and add

glew32mx.lib
glew32.lib

Run the project, compiles all your code correctly then I get


Code: [Select]

1>Constructs.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
1>Constructs.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
1>Constructs.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
1>Light.obj : error LNK2001: unresolved external symbol __imp__glClearDepth@8
1>Light.obj : error LNK2001: unresolved external symbol __imp__glDepthFunc@4
1>Light.obj : error LNK2001: unresolved external symbol __imp__glOrtho@48
1>Light.obj : error LNK2001: unresolved external symbol __imp__glColor4f@16
1>Light.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
1>Light.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
1>Light.obj : error LNK2001: unresolved external symbol __imp__glEnable@4
1>Light.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glClear@4
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glColor4b@16
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glColorMask@16
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp____glewBlendFuncSeparate
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glDisable@4
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glPopMatrix@0
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glPushMatrix@0
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glBlendFunc@8
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glScalef@12
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glTexCoord2i@8
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glTranslatef@12
1>SFML_OpenGL.obj : error LNK2001: unresolved external symbol __imp__glewInit
1>D:\C++\SFML\SFML2.0Test\Release\SFML2.0Test.exe : fatal error LNK1120: 23 unresolved externals
Trying so very hard to finish at-least one project.

Watch out for the RAII police, they will get you.

www.bantersaurus-games.com

Roose Bolton of the Dreadfort

  • Full Member
  • ***
  • Posts: 113
  • Full-time Procrastinator, Part-time programmer.
    • View Profile
    • Personal Portfolio/Website/Blog
SFML Light System - Let There Be Light
« Reply #52 on: March 08, 2012, 09:42:50 pm »
EDIT: Do you need C++0x installed or something?
Trying so very hard to finish at-least one project.

Watch out for the RAII police, they will get you.

www.bantersaurus-games.com

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
SFML Light System - Let There Be Light
« Reply #53 on: March 08, 2012, 10:20:17 pm »
Yes, you need C++0x features. The chances are that your compiler has them. If you are using VS2010, you will have all of the necessary C++0x features.

It looks like you didn't link to OpenGL. Go to the linker input, and add:

OpenGL32.lib
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

Roose Bolton of the Dreadfort

  • Full Member
  • ***
  • Posts: 113
  • Full-time Procrastinator, Part-time programmer.
    • View Profile
    • Personal Portfolio/Website/Blog
SFML Light System - Let There Be Light
« Reply #54 on: March 09, 2012, 03:06:54 am »
Yeah I am using VC2010..

oo adding Opengl linker brought the errors down too only 2!

anything else im missing?

sfml-graphics.lib
sfml-audio.lib
sfml-system.lib
sfml-window.lib
sfml-network.lib
glew32mx.lib
glew32.lib
OpenGL32.lib

Error -

Code: [Select]

1>------ Build started: Project: SFML2.0Test, Configuration: Release Win32 ------
1>Build started 09/03/2012 02:06:59.
1>InitializeBuildStatus:
1>  Touching "Release\SFML2.0Test.unsuccessfulbuild".
1>ClCompile:
1>  All outputs are up-to-date.
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp____glewBlendFuncSeparate
1>SFML_OpenGL.obj : error LNK2001: unresolved external symbol __imp__glewInit
1>D:\C++\SFML\SFML2.0Test\Release\SFML2.0Test.exe : fatal error LNK1120: 2 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.40
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Thanks a lot for the help
Trying so very hard to finish at-least one project.

Watch out for the RAII police, they will get you.

www.bantersaurus-games.com

Roose Bolton of the Dreadfort

  • Full Member
  • ***
  • Posts: 113
  • Full-time Procrastinator, Part-time programmer.
    • View Profile
    • Personal Portfolio/Website/Blog
SFML Light System - Let There Be Light
« Reply #55 on: March 09, 2012, 03:24:54 am »
Never mind, fixed it.

GLEW 1.7.0(Newest Release) does not work with Let There Be Light.

I used Glew 1.6.0 and works fine.
Trying so very hard to finish at-least one project.

Watch out for the RAII police, they will get you.

www.bantersaurus-games.com

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
SFML Light System - Let There Be Light
« Reply #56 on: March 09, 2012, 03:41:24 am »
I am glad that you solved it  :)
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

Roose Bolton of the Dreadfort

  • Full Member
  • ***
  • Posts: 113
  • Full-time Procrastinator, Part-time programmer.
    • View Profile
    • Personal Portfolio/Website/Blog
SFML Light System - Let There Be Light
« Reply #57 on: March 09, 2012, 06:48:22 am »
I just noticed, if two lights cross each other or touch etc, hard edged cubes appear.. is this a bug? If not then is there a way to stop it happening? As the game I want to make will have lots of lights touching.

Cheers lolz
Trying so very hard to finish at-least one project.

Watch out for the RAII police, they will get you.

www.bantersaurus-games.com

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
SFML Light System - Let There Be Light
« Reply #58 on: March 10, 2012, 12:55:10 am »
Oh, woops, I forgot to make sure that the alpha buffer was cleared, which is apparently the cause of these strange artifacts :oops: . Try the latest version, should be fixed!
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

Roose Bolton of the Dreadfort

  • Full Member
  • ***
  • Posts: 113
  • Full-time Procrastinator, Part-time programmer.
    • View Profile
    • Personal Portfolio/Website/Blog
SFML Light System - Let There Be Light
« Reply #59 on: March 10, 2012, 04:52:29 am »
overridden my old lighting and added the new version now getting this when I compile

Code: [Select]

1>LightSystem.obj : error LNK2019: unresolved external symbol "public: void __thiscall ltbl::EmissiveLight::Render(void)" (?Render@EmissiveLight@ltbl@@QAEXXZ) referenced in function "public: void __thiscall ltbl::LightSystem::RenderLights(void)" (?RenderLights@LightSystem@ltbl@@QAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ltbl::EmissiveLight::SetCenter(class ltbl::Vec2f const &)" (?SetCenter@EmissiveLight@ltbl@@QAEXABVVec2f@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ltbl::EmissiveLight::SetRotation(float)" (?SetRotation@EmissiveLight@ltbl@@QAEXM@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ltbl::EmissiveLight::SetTexture(class sf::Texture *)" (?SetTexture@EmissiveLight@ltbl@@QAEXPAVTexture@sf@@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ltbl::EmissiveLight::EmissiveLight(void)" (??0EmissiveLight@ltbl@@QAE@XZ) referenced in function _main
1>D:\C++\SFML\SFML2.0Test\Debug\SFML2.0Test.exe : fatal error LNK1120: 5 unresolved externals


Did you include some new stuff when you changed emissive lights?

PS: Just tried it again - older version works fine, this new version gets these errors..
Trying so very hard to finish at-least one project.

Watch out for the RAII police, they will get you.

www.bantersaurus-games.com