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

Pages: [1] 2
1
Hello all,

I am trying to make a gui application with code blocks, SFML, and Cmake but on windows I have a problem of the console window being displayed. I do not want it to be displayed.

I am using cmake to generate my project. I am generating Codeblocks Mingw32 makefiles. Once I generate those makefiles I open up the generated codeblocks project and try to change the setting from console to GUI in properties but it doesn't work.

I believe the problem is that I am setting a variable in codeblocks even though codeblocks is using Mingw32 as a tool to compile so the setting has no effect. Is there any way to set my program to be a GUI in the Cmake file?

Right now I have a workaround of using windows.h to find the console windows and hide it with this command function in my console class:
void ConsoleWindow::HideConsoleWindow (void){
//----------------------------------------------------------------------------------------------------
   ShowWindow(this->CONSOLE, SW_HIDE);
}

I like how this works, but I don't like how the console pops up on the start of the program then disappears. Is there anyway I can fix this via Cmake or codeblocks?

Thanks,
Brent

2
Graphics / GetEvent() Deprecated? - SFML 2
« on: April 18, 2011, 10:01:54 pm »
Well after I updated my repo and re-built SFML I noticed that there was no GetEvent() function because when I tried to build my project I got this:

class sf::RenderWindow’ has no member named ‘GetEvent’

Could someone please help me out here?

3
General / Cmake Probelms SFML 2 MinGW
« on: January 22, 2011, 08:08:28 pm »
Update: I got the makefile thing fixed but now I am having trouble with compiling.
Here are some of my errors.
Code: [Select]
Linking console executable: bin\Debug\GL_TestArea.exe
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(RenderWindow.cpp.obj):RenderWindow.cpp:(.text+0x51): undefined reference to `_Unwind_Resume'
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(RenderWindow.cpp.obj):RenderWindow.cpp:(.text+0xf3): undefined reference to `_Unwind_Resume'
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(RenderWindow.cpp.obj):RenderWindow.cpp:(.text+0x17a): undefined reference to `_Unwind_Resume'
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(RenderWindow.cpp.obj):RenderWindow.cpp:(.text+0x1e8): undefined reference to `_Unwind_Resume'
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(RenderWindow.cpp.obj):RenderWindow.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: Dwarf Error: Offset (11020) greater than or equal to (null) size (4954657).
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(Image.cpp.obj):Image.cpp:(.text+0x87): undefined reference to `_Unwind_Resume'
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(Image.cpp.obj):Image.cpp:(.text+0x170): undefined reference to `_Unwind_Resume'
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '20039', this reader only handles version 2 and 3 information.
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(Image.cpp.obj):Image.cpp:(.text+0x259): undefined reference to `_Unwind_Resume'
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '11075', this reader only handles version 2 and 3 information.
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(Image.cpp.obj):Image.cpp:(.text+0x2fb): undefined reference to `_Unwind_Resume'
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: Dwarf Error: found dwarf version '11828', this reader only handles version 2 and 3 information.
C:\Program Files (x86)\CodeBlocks\MinGW\lib/libsfml-graphics-s-d.a(Image.cpp.obj):Image.cpp:(.text+0x3a4): undefined reference to `_Unwind_Resume'
 






















Previous stuff to help others that i figured out down here...

UPDATE:
Tried using vc++ libs but only got errors like this.
undefined reference to `sf::RenderWindow::~RenderWindow()'
So how do I use a makefile?


Update:
I made makefiles but I can't figure out how to compile them..
I tried a codeblocks makefile and when opened in CB nothing happened either. It said
 'make.exe -s -f Makefile all' in 'C:\SFML\Build\CodeBlocks' failed.

Update:
I installed mingw.
I went into cmd and typed this: set PATH=%PATH%;C:\MinGW\bin cmake
Then I went back to cmake and it said. Missing libgmp-10.dll.




Original Post:

Ok well I have the latest source from the svn and I tried opening it up in cmake and setting the files the mingw make files. And then it gave me this:






Here are my errors:
Code: [Select]

CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:C:/SFML/Build/CodeBlocks/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:C:/SFML/Build/CodeBlocks/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
Configuring incomplete, errors occurred!



Also that shell script thing i dont understand! IDK what to do about it. I think that is my problem.

4
General / How do I create my own GetPosition() Function?
« on: December 28, 2010, 05:07:32 am »
Well I am working with OpenGL now and I want to return the position of the 3DRect like this. GetPosition().x or GetPosition.y or GetPosition().z. So how would I do this?

Also on a side note. How do I rotate around a local origin and not a world origin. Like rotate in place?

5
Graphics / GluPerspective vs. GlOrtho
« on: December 23, 2010, 12:39:31 am »
Well I am having some trouble. I am trying to be able to draw anywhere in the world but be able to move the camera. Like any 3D game. But IDK which one to use, glOrtho or gluperspective. Whenever i try gluperspective and try to draw at 0,0 it is at the center of my screen. I want it to be in the bottom corner... But with glOrtho it makes everything in teh world really small but draws them in the corner.. So could some point me in the right direction.. And also how I would move the camera..

I know there is glulookat but I will use that after I make my player...

6
Graphics / Creating an OpenGL Cube Class
« on: December 19, 2010, 08:30:07 pm »
Ok Well I am trying to create an OpenGL cube class but if I try and translate the cube and then have a gl shape folowing it, it affects that shape. Is there anyway that I can have a matrix or something for each cube shape and have every tranlation or rotation done no matter where it's done only effects my shape. So it kinda like each shape has it's own little space in memory and when I call a function it affects that variable or matrix which is in each class.

So pretty much how would I make a function only affect a shape of my choice. would I have to put the shape in a seperate matrix and then translate that martix which is a variable for the cube class?

If so how would I do this?

7
General / How do I use /MT?
« on: December 19, 2010, 06:03:24 am »
Ok well I am using sfml static libraries and I want to statically include the dll's needed for my program. But whenver is set /MT it gives me a load of linker errors.

8
Graphics / OpenGL not Texturing the Way I Want
« on: December 15, 2010, 05:20:30 am »
Well Whenever I use this code which I made myself, it only draws the  texture of the other shape so obviosly these shapes are acting as one and I am wondering how do I give each shape its own caracteristics.

Code: [Select]

#include "Block.h"

Block::~Block()
{
glDeleteTextures(1, &TopTexture);
glDisable(GL_TEXTURE_2D);
}

Block::Block()
{
}

void Block::GetPositionX()
{

}

void Block::GetPositionY()
{

}

void Block::GetPositionZ()
{

}

void Block::GetRotation()
{

}

void Block::GetType()
{

}

void Block::SetPosition(float x,float y, float z)
{
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(x,y,z);
}

void Block::Rotation(float angle, float x, float y, float z)
{
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRotatef(angle,x,y,z);
}

void Block::Draw()
{
glMatrixMode(GL_MODELVIEW);
glEnable(GL_TEXTURE_2D);

        // Draw a cube
        float size = 20.f;
        glBegin(GL_QUADS);

glBindTexture(GL_TEXTURE_2D, SideTexture);
glColor4f(1.f, 1.f, 1.f, 1.f);

            glTexCoord2f(0, 0); glVertex3f(-size, -size, -size);
            glTexCoord2f(0, 1); glVertex3f(-size,  size, -size);
            glTexCoord2f(1, 1); glVertex3f( size,  size, -size);
            glTexCoord2f(1, 0); glVertex3f( size, -size, -size);

            glTexCoord2f(0, 0); glVertex3f(-size, -size, size);
            glTexCoord2f(0, 1); glVertex3f(-size,  size, size);
            glTexCoord2f(1, 1); glVertex3f( size,  size, size);
            glTexCoord2f(1, 0); glVertex3f( size, -size, size);

            glTexCoord2f(0, 0); glVertex3f(-size, -size, -size);
            glTexCoord2f(0, 1); glVertex3f(-size,  size, -size);
            glTexCoord2f(1, 1); glVertex3f(-size,  size,  size);
            glTexCoord2f(1, 0); glVertex3f(-size, -size,  size);

            glTexCoord2f(0, 0); glVertex3f(size, -size, -size);
            glTexCoord2f(0, 1); glVertex3f(size,  size, -size);
            glTexCoord2f(1, 1); glVertex3f(size,  size,  size);
            glTexCoord2f(1, 0); glVertex3f(size, -size,  size);

glDisable(SideTexture);
glEnable(TopTexture);

glBindTexture(GL_TEXTURE_2D, TopTexture);
glColor4f(1.f, 1.f, 1.f, 1.f);

            glTexCoord2f(0, 1); glVertex3f(-size, -size,  size);
            glTexCoord2f(0, 0); glVertex3f(-size, -size, -size);
            glTexCoord2f(1, 0); glVertex3f( size, -size, -size);
            glTexCoord2f(1, 1); glVertex3f( size, -size,  size);

glBindTexture(GL_TEXTURE_2D, BottomTexture);
glColor4f(1.f, 1.f, 1.f, 1.f);

            glTexCoord2f(0, 1); glVertex3f(-size, size,  size);
            glTexCoord2f(0, 0); glVertex3f(-size, size, -size);
            glTexCoord2f(1, 0); glVertex3f( size, size, -size);
            glTexCoord2f(1, 1); glVertex3f( size, size,  size);

        glEnd();
}

void Block::LoadTexture(BType BlockType)
{
std::string imagefileTop;
std::string imagefileSide;
std::string imagefileBottom;


if(BlockType == Grass) {imagefileTop = "GrassTop.jpg"; imagefileSide = "GrassSide.jpg"; imagefileBottom = "Dirt.jpg";}
if(BlockType == Dirt) {imagefileTop = "Dirt.jpg"; imagefileSide = "Dirt.jpg"; imagefileBottom = "Dirt.jpg";}
if(BlockType == Stone) {imagefileTop = "Stone.jpg"; imagefileSide = "Stone.jpg"; imagefileBottom = "Stone.jpg";}
if(BlockType == Wood) {imagefileTop = "WoodTop.jpg"; imagefileSide = "WoodSide.jpg"; imagefileBottom = "WoodTop.jpg";}

// Load an OpenGL texture.
    // We could directly use a sf::Image as an OpenGL texture (with its Bind() member function),
    // but here we want more control on it (generate mipmaps, ...) so we create a new one from the image pixels
    TopTexture = 0;
    {

        sf::Image image;
        if (!image.LoadFromFile("resources\\" + imagefileTop))
            std::cout << "Could Not Load Texture";
        glGenTextures(1, &TopTexture);
        glBindTexture(GL_TEXTURE_2D, TopTexture);
        gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, image.GetWidth(), image.GetHeight(), GL_RGBA, GL_UNSIGNED_BYTE, image.GetPixelsPtr());
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    }

SideTexture = 0;
    {

        sf::Image image;
        if (!image.LoadFromFile("resources\\" + imagefileSide))
            std::cout << "Could Not Load Texture";
        glGenTextures(1, &SideTexture);
        glBindTexture(GL_TEXTURE_2D, SideTexture);
        gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, image.GetWidth(), image.GetHeight(), GL_RGBA, GL_UNSIGNED_BYTE, image.GetPixelsPtr());
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    }

BottomTexture = 0;
    {

        sf::Image image;
        if (!image.LoadFromFile("resources\\" + imagefileBottom))
            std::cout << "Could Not Load Texture";
        glGenTextures(1, &BottomTexture);
        glBindTexture(GL_TEXTURE_2D, BottomTexture);
        gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, image.GetWidth(), image.GetHeight(), GL_RGBA, GL_UNSIGNED_BYTE, image.GetPixelsPtr());
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    }
}




I call it like this in main..
Block Grass;
Grass.LoadTexture()

in the while loop

Grass.SetPosition(x,y,z); //Cube doesnt display inless this is in while..
Grass.Draw();

9
General / Quick Question about OpenGL
« on: December 15, 2010, 03:19:42 am »
Well I am trying to create a class called Block. The blocks are all the same but with different textures. With the texture is there anyway I can use just sfml to put an image on the block and have it pretty much glued on. Also here is my real question, how do i manipulate one shape? The constructor of this class will call all of the verts but if I want to call glrotate3f or gltranslate3f. How would I go about manipulating just that shape? Would I need my own matrix? Or would I just call glMatrixMode(MODEL_VIEW) or whatever it is and then translate. And it would know what shape I am talking about or not?

10
SFML projects / Can Someone Test My Game?
« on: December 11, 2010, 09:52:35 pm »
Well i have a pikin sticks game I made and I don't have another computer to test it on. It is the debug version not the release, I hope that doesnt matter.

Here: http://www.mediafire.com/?s454jgrzdcp35om

11
General / Debug Builds but Release Doesn't
« on: December 11, 2010, 09:40:12 pm »
Well I am making a pikin sticks game and I have the debug building fine but when I try and build the release it gives me these errors.

Code: [Select]
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ) already defined in libcpmt.lib(locale0.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@YAXPBD@Z) already defined in libcpmt.lib(xthrow.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPBD@Z) already defined in libcpmt.lib(xthrow.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::locale::facet::_Incref(void)" (?_Incref@facet@locale@std@@QAEXXZ) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in libcpmt.lib(xlock.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in libcpmt.lib(xlock.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(void)" (?_Init@locale@std@@CAPAV_Locimp@12@XZ) already defined in libcpmt.lib(locale0.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::locale::facet * __thiscall std::locale::facet::_Decref(void)" (?_Decref@facet@locale@std@@QAEPAV123@XZ) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __thiscall std::_Locinfo::~_Locinfo(void)" (??1_Locinfo@std@@QAE@XZ) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xruntime_error(char const *)" (?_Xruntime_error@std@@YAXPBD@Z) already defined in libcpmt.lib(xthrow.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "private: __thiscall std::locale::_Locimp::_Locimp(bool)" (??0_Locimp@locale@std@@AAE@_N@Z) already defined in libcpmt.lib(locale0.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: virtual __thiscall std::locale::_Locimp::~_Locimp(void)" (??1_Locimp@locale@std@@MAE@XZ) already defined in libcpmt.lib(locale0.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "bool __cdecl std::uncaught_exception(void)" (?uncaught_exception@std@@YA_NXZ) already defined in libcpmt.lib(uncaught.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Init(void)" (?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::~basic_streambuf<char,struct std::char_traits<char> >(void)" (??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::basic_streambuf<char,struct std::char_traits<char> >(void)" (??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::setg(char *,char *,char *)" (?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: char __thiscall std::basic_ios<char,struct std::char_traits<char> >::widen(char)const " (?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual __thiscall std::basic_istream<char,struct std::char_traits<char> >::~basic_istream<char,struct std::char_traits<char> >(void)" (??1?$basic_istream@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: virtual __thiscall std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void)" (??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __thiscall std::basic_istream<char,struct std::char_traits<char> >::basic_istream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z) already defined in main.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "private: static void __cdecl std::ios_base::_Ios_base_dtor(class std::ios_base *)" (?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z) already defined in libcpmt.lib(ios.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::exception::exception(char const * const &)" (??0exception@std@@QAE@ABQBD@Z) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _memmove already defined in LIBCMT.lib(memmove.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::bad_cast::bad_cast(char const *)" (??0bad_cast@std@@QAE@PBD@Z) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception@std@@QAE@ABV01@@Z) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _memchr already defined in LIBCMT.lib(memchr.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _ldexp already defined in LIBCMT.lib(_ldexp_.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fclose already defined in LIBCMT.lib(fclose.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _realloc already defined in LIBCMT.lib(realloc.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strtol already defined in LIBCMT.lib(strtol.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strncmp already defined in LIBCMT.lib(strncmp.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _tolower already defined in LIBCMT.lib(tolower.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __lock_file already defined in LIBCMT.lib(_file.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __unlock_file already defined in LIBCMT.lib(_file.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fflush already defined in LIBCMT.lib(fflush.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _exit already defined in LIBCMT.lib(crt0dat.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: ___iob_func already defined in LIBCMT.lib(_file.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _sprintf already defined in LIBCMT.lib(sprintf.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strrchr already defined in LIBCMT.lib(strrchr.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _getenv already defined in LIBCMT.lib(getenv.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _atol already defined in LIBCMT.lib(atox.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::`vbase destructor'(void)" (??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in main.obj
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library



If I use NoDEFUALTLIB then I get every sfml error under the sun..

12
Graphics / I want to Get Some OpenGL stuff strait...
« on: December 11, 2010, 04:34:55 pm »
Ok well Here is the example code from the repository and I have some questions about it after the code.

Code: [Select]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <SFML\Window.hpp>
#include <SFML/OpenGL.hpp>
#include <iostream>

////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Create the main window
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML OpenGL");

    // Create a sprite for the background
    sf::Image backgroundImage;
    if (!backgroundImage.LoadFromFile("resources/background.jpg"))
        return EXIT_FAILURE;
    sf::Sprite background(backgroundImage);

    // Load an OpenGL texture.
    // We could directly use a sf::Image as an OpenGL texture (with its Bind() member function),
    // but here we want more control on it (generate mipmaps, ...) so we create a new one from the image pixels
    GLuint texture = 0;
    {
        sf::Image image;
        if (!image.LoadFromFile("resources/texture.jpg"))
            return EXIT_FAILURE;
        glGenTextures(1, &texture);
        glBindTexture(GL_TEXTURE_2D, texture);
        gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, image.GetWidth(), image.GetHeight(), GL_RGBA, GL_UNSIGNED_BYTE, image.GetPixelsPtr());
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    }

    // Enable Z-buffer read and write
    glEnable(GL_DEPTH_TEST);
    glDepthMask(GL_TRUE);
    glClearDepth(1.f);

    // Setup a perspective projection
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(90.f, 1.f, 1.f, 500.f);

    // Bind our texture
    glEnable(GL_TEXTURE_2D);
    glBindTexture(GL_TEXTURE_2D, texture);
    glColor4f(1.f, 1.f, 1.f, 1.f);

    // Create a clock for measuring the time elapsed
    sf::Clock clock;

    // Start game loop
    while (window.IsOpened())
    {
window.ShowMouseCursor(false);
        // Process events
        sf::Event event;
        while (window.GetEvent(event))
        {
            // Close window : exit
            if (event.Type == sf::Event::Closed)
{
                window.Close();
return 0;
}

            // Escape key : exit
            if ((event.Type == sf::Event::KeyPressed) && (event.Key.Code == sf::Key::Escape))
                window.Close();
if ((event.Type == sf::Event::KeyPressed) && (event.Key.Code == sf::Key::Up))
{
}
if ((event.Type == sf::Event::KeyPressed) && (event.Key.Code == sf::Key::Down))
{

}

            // Adjust the viewport when the window is resized
            if (event.Type == sf::Event::Resized)
                glViewport(0, 0, event.Size.Width, event.Size.Height);
        }

        // Draw the background
        window.SaveGLStates();
        window.Draw(background);
        window.RestoreGLStates();

        // Activate the window before using OpenGL commands.
        // This is useless here because we have only one window which is
        // always the active one, but don't forget it if you use multiple windows
        window.SetActive();

        // Clear the depth buffer
        glClear(GL_DEPTH_BUFFER_BIT);

        // We get the position of the mouse cursor, so that we can move the box accordingly
        float x =  window.GetInput().GetMouseX() * 200.f / window.GetWidth()  - 100.f;
        float y = -window.GetInput().GetMouseY() * 200.f / window.GetHeight() + 100.f;

        // Apply some transformations
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();
        glTranslatef(x, y, -100.f);
        //glRotatef(clock.GetElapsedTime() * 50, 1.f, 0.f, 0.f);
        glRotatef(clock.GetElapsedTime() * 30, 0.f, 1.f, 0.f);
        //glRotatef(clock.GetElapsedTime() * 90, 0.f, 0.f, 1.f);

        // Draw a cube
        float size = 20.f;
        glBegin(GL_QUADS);

            glTexCoord2f(0, 0); glVertex3f(-size, -size, -size);
            glTexCoord2f(0, 1); glVertex3f(-size,  size, -size);
            glTexCoord2f(1, 1); glVertex3f( size,  size, -size);
            glTexCoord2f(1, 0); glVertex3f( size, -size, -size);

            glTexCoord2f(0, 0); glVertex3f(-size, -size, size);
            glTexCoord2f(0, 1); glVertex3f(-size,  size, size);
            glTexCoord2f(1, 1); glVertex3f( size,  size, size);
            glTexCoord2f(1, 0); glVertex3f( size, -size, size);

            glTexCoord2f(0, 0); glVertex3f(-size, -size, -size);
            glTexCoord2f(0, 1); glVertex3f(-size,  size, -size);
            glTexCoord2f(1, 1); glVertex3f(-size,  size,  size);
            glTexCoord2f(1, 0); glVertex3f(-size, -size,  size);

            glTexCoord2f(0, 0); glVertex3f(size, -size, -size);
            glTexCoord2f(0, 1); glVertex3f(size,  size, -size);
            glTexCoord2f(1, 1); glVertex3f(size,  size,  size);
            glTexCoord2f(1, 0); glVertex3f(size, -size,  size);

            glTexCoord2f(0, 1); glVertex3f(-size, -size,  size);
            glTexCoord2f(0, 0); glVertex3f(-size, -size, -size);
            glTexCoord2f(1, 0); glVertex3f( size, -size, -size);
            glTexCoord2f(1, 1); glVertex3f( size, -size,  size);

            glTexCoord2f(0, 1); glVertex3f(-size, size,  size);
            glTexCoord2f(0, 0); glVertex3f(-size, size, -size);
            glTexCoord2f(1, 0); glVertex3f( size, size, -size);
            glTexCoord2f(1, 1); glVertex3f( size, size,  size);

        glEnd();

        // Draw some text on top of our OpenGL object
        window.SaveGLStates();
        sf::Text text("SFML / OpenGL demo");
        text.SetPosition(250.f, 450.f);
        text.SetColor(sf::Color(255, 255, 255, 170));
        window.Draw(text);
        window.RestoreGLStates();

        // Finally, display the rendered frame on screen
        window.Display();
    }

    // Don't forget to destroy our texture
    glDeleteTextures(1, &texture);

    return EXIT_SUCCESS;
}


So right off the bat you set up a texture with gl called texture right?
Then the Opengl initiative stuff and then you bind the texture corrrect?
After that you start the main loop and get the events and then You save the gl states? what does that do? But after that you restore it? Does it do Opengl stuff like popping and pushing matixes?
What does set active do?

Also when you call all of the tranformations how do you make it only apply to one shape? Like make it more object oriented?

SOrry I have more questions but I gtg..

13
Graphics / Input Is not being handled well
« on: December 10, 2010, 04:11:55 am »
Well I have built my program fine but when I try and use it and I use my mouse on the window it stops working. I am pretty sure it is not handling input correctly... Also one of my images is just showing up white. It is just an inherited sprite class...

14
General / Updated SFML 2 Cmake Not Working...
« on: December 08, 2010, 04:28:54 pm »
Well I just updated my svn repository and I loaded up the sfml2 folder and it said this:

Code: [Select]
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindDoxygen.cmake:80 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  doc/CMakeLists.txt:15 (find_package)

15
Window / OpenGL not Working
« on: December 07, 2010, 07:14:50 am »
Here is my code :

Code: [Select]
#include <SFML\Graphics.hpp>
#include <SFML\OpenGL.hpp>


GLfloat rquad;

void Draw() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer
glShadeModel(GL_SMOOTH);
   glLoadIdentity(); // Reset The Current Modelview Matrix
   glPushMatrix();
glRotatef(rquad,0.0,1.0,0);
glBegin(GL_QUADS);
glColor3f(2.0, 0.0, 0.0);  //

glVertex3f(0.30, 0.30, 0.0);
glVertex3f(0.30, 0.70, 0.0);
glVertex3f(0.70, 0.70, 0.0);
glVertex3f(0.70, 0.30, 0.0);

glColor3f(255.0, 0.0, 0.0); //

glVertex3f(0.70, 0.30, 0.3);
glVertex3f(0.70, 0.70, 0.3);
glVertex3f(0.70, 0.70, 0.0);
glVertex3f(0.70, 0.30, 0.0);

glColor3f(0.0, 255.0, 0.0); //

glVertex3f(0.30, 0.70, 0.3);
glVertex3f(0.30, 0.30, 0.3);
glVertex3f(0.70, 0.30, 0.3);
glVertex3f(0.70, 0.70, 0.3);

glColor3f(0.0, 0.0, 255.0); //

glVertex3f(0.30, 0.70, 0.0);
glVertex3f(0.30, 0.30, 0.0);
glVertex3f(0.30, 0.30, 0.3);
glVertex3f(0.30, 0.70, 0.3);

glColor3f(1.0,1.0,1.0);  //

glVertex3f(0.30, 0.70, 0.0);
glVertex3f(0.70, 0.70, 0.0);
glVertex3f(0.30, 0.70, 0.3);
glVertex3f(0.70, 0.70, 0.3);

glVertex3f(0.30, 0.30, 0.0);
glVertex3f(0.70, 0.30, 0.0);
glVertex3f(0.30, 0.30, 0.3);
glVertex3f(0.70, 0.30, 0.3);


glEnd();
glPopMatrix();
rquad+=-0.5;
glFlush();
}

void Initialize() {
glClearColor(0.0, 0.0, 0.0, 0.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}

int main(int iArgc, char** cppArgv) {
sf::Window App(sf::VideoMode(800,800,8), "OpengGL Test");
Initialize();
while(App.IsOpened())
{
glClear(GL_COLOR_BUFFER_BIT);
Draw();
App.Display();
}
return 0;
}


Ok Well I have gotten rid of those errors by creating a new project and trying to do all of this again but now window doesnt display. It doesnt pop up at all...
[/code]

Pages: [1] 2
anything