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

Pages: [1]
1
General / ZipLoader
« on: December 18, 2009, 05:47:01 pm »
Hi,

I was trying to test the exemple of the ZipLoader working with zlib and minizip.

I am not able to compile it on windows/linux.

I have downloaded zlib123.zip http://www.winimage.com/zLibDll/zlib123.zip  on linux.
Quote
mopie@mopie-desktop 196)make clean
rm -f *.o *~ example minigzip \
      libz.* foo.gz so_locations \
      _match.s maketree contrib/infback9/*.o
(mopie@mopie-desktop 197)make
cc -O   -c -o example.o example.c
cc -O   -c -o adler32.o adler32.c
cc -O   -c -o compress.o compress.c
cc -O   -c -o crc32.o crc32.c
cc -O   -c -o gzio.o gzio.c
cc -O   -c -o uncompr.o uncompr.c
cc -O   -c -o deflate.o deflate.c
cc -O   -c -o trees.o trees.c
cc -O   -c -o zutil.o zutil.c
cc -O   -c -o inflate.o inflate.c
cc -O   -c -o infback.o infback.c
cc -O   -c -o inftrees.o inftrees.c
cc -O   -c -o inffast.o inffast.c
ar rc libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
cc -O -o example example.o libz.a
cc -O   -c -o minigzip.o minigzip.c
cc -O -o minigzip minigzip.o libz.a
(mopie@mopie-desktop 198)cd ..
(mopie@mopie-desktop 199)g++ -Iminizip/contrib/minizip -lsfml-system -Lzlib-1.2.3 -lz ZipLoader.cpp main.cpp
/tmp/cc57acPv.o: In function `Zip::LoadZipFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int&)':
ZipLoader.cpp:(.text+0x3fc): undefined reference to `unzOpen'
ZipLoader.cpp:(.text+0x448): undefined reference to `unzLocateFile'
ZipLoader.cpp:(.text+0x468): undefined reference to `unzOpenCurrentFile'
ZipLoader.cpp:(.text+0x4bf): undefined reference to `unzGetCurrentFileInfo'
ZipLoader.cpp:(.text+0x4f5): undefined reference to `unzReadCurrentFile'
ZipLoader.cpp:(.text+0x50b): undefined reference to `unzCloseCurrentFile'
ZipLoader.cpp:(.text+0x516): undefined reference to `unzClose'
collect2: ld returned 1 exit status
(mopie@mopie-desktop 200)


I have no idea why it doesnot work.

Have any suggestions ?

Thanks

2
Graphics / sfml and opengl
« on: December 14, 2009, 03:51:09 pm »
Yeah. here is a little messy test:

Code: [Select]

#include <SFML/Graphics.hpp>

#include <iostream>
#include <fstream>

int main()
{
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "sfml");
float x = 400;
float y = 300;
App.PreserveOpenGLStates(true);
App.SetFramerateLimit(60);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0,800,600,0,-1,1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

sf::Image texture;
if (!texture.LoadFromFile("data\\text.jpg"))
return 0;
while (App.IsOpened())
{
sf::Event Event;
while (App.GetEvent(Event))
{
if (Event.Type == sf::Event::Closed)
App.Close();
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close();
if (Event.Type == sf::Event::Resized)
glViewport(0, 0, Event.Size.Width, Event.Size.Height);
}

glClear (GL_COLOR_BUFFER_BIT);
glLoadIdentity();
glTranslatef(x, y,0);          
texture.Bind();
glBegin(GL_QUADS);
glTexCoord2i(0,0); glVertex2f(0,0);
glTexCoord2i(1,0); glVertex2f(0,50);
glTexCoord2i(1,1); glVertex2f(50,50);
glTexCoord2i(0,1); glVertex2f(50, 0);
glEnd();
App.Display();


App.Display();
}

return EXIT_SUCCESS;
}


The code seems to work properly. But at the closing of the program i got the following message :

Code: [Select]
An internal OpenGL call failed in image.cpp (481) : GL_INVALID_OPERATION, the specified operation is not allowed in the current state
An internal OpenGL call failed in image.cpp (482) : GL_INVALID_OPERATION, the specified operation is not allowed in the current state

3
Graphics / sfml and opengl
« on: December 14, 2009, 03:11:31 pm »
up plz ;)

4
Graphics / sfml and opengl
« on: December 13, 2009, 01:34:16 am »
I did some tests and all is ok ;)

But i have now an other problem.

I have discovered the bind method into the sf::image class.

I use it to apply some textures to my scene.

But the problem is that when i use the bind method i got some stanges messages at the closing of the program:

Code: [Select]
An internal OpenGL call failed in image.cpp (481) : GL_INVALID_OPERATION, the specified operation is not allowed in the current state
An internal OpenGL call failed in image.cpp (482) : GL_INVALID_OPERATION, the specified operation is not allowed in the current state


My code is the following :

Code: [Select]


//Initalization//
sf::RenderWindow App(sf::VideoMode(WIDTH, HEIGHT), "SFML OpenGL");
App.PreserveOpenGLStates(true);
App.SetFramerateLimit(60);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0,WIDTH,HEIGHT,0,-1,1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();        

if (!this->_texture->LoadFromFile("img\\2.bmp"))
//except


//render func
      glClear (GL_COLOR_BUFFER_BIT);
  glLoadIdentity();
glTranslatef(this->getX(), this->getY(),0);
this->_texture->Bind();
glBegin(GL_QUADS);
glTexCoord2i(0,0); glVertex2f(0,0);
glTexCoord2i(1,0); glVertex2f(0,50);
glTexCoord2i(1,1); glVertex2f(50,50);
glTexCoord2i(0,1); glVertex2f(50, 0);
glEnd();
App.Display();




Thanks ;)

5
Graphics / sfml and opengl
« on: December 11, 2009, 06:45:27 pm »
ok. Thanks. I'll do some tests :)

6
Graphics / sfml and opengl
« on: December 11, 2009, 06:05:54 pm »
Now the compilation and linkage  work. :)

But i have always the problem at the closing of the program.

Here is a picture to show you :
http://www.hiboox.fr/go/images/informatique/untitled2,b685e5c598814b0ae6ec6c34f2c9ef47.png.html

7
Graphics / sfml and opengl
« on: December 11, 2009, 05:54:13 pm »
ok. Thanks.

I added opengl32.lib.
Some problems were solved but there are always this one :
Code: [Select]
Error 1 error LNK2001: unresolved external symbol _gluPerspective@32 main.obj
Error 2 error LNK2001: unresolved external symbol _gluBuild2DMipmaps@28 main.obj


Do you have an idea ?

8
Graphics / sfml and opengl
« on: December 11, 2009, 05:35:50 pm »
Oki. Thanks for your answer.

But where can i find this lib ?

The website of opengl is not very efficient to found something...

9
Graphics / sfml and opengl
« on: December 11, 2009, 05:07:43 pm »
hello.

I'm discovering sfml lib and i would like to be able to use opengl.

I pasted the code of the tutorial (http://www.sfml-dev.org/tutorials/1.5/window-opengl-fr.php).

I was not compiling because of errors during the linkage.

Code: [Select]

Error 1 error LNK2001: unresolved external symbol __imp__glDeleteTextures@8 main.obj
Error 2 error LNK2001: unresolved external symbol __imp__glClearDepth@8 main.obj
Error 3 error LNK2001: unresolved external symbol __imp__glClear@4 main.obj
Error 4 error LNK2001: unresolved external symbol __imp__glTexCoord2f@8 main.obj
Error 5 error LNK2001: unresolved external symbol __imp__glEnd@0 main.obj
Error 6 error LNK2001: unresolved external symbol __imp__glBindTexture@8 main.obj
Error 7 error LNK2001: unresolved external symbol __imp__glBegin@4 main.obj
Error 8 error LNK2001: unresolved external symbol __imp__glDepthMask@4 main.obj
Error 9 error LNK2001: unresolved external symbol __imp__glColor4f@16 main.obj
Error 10 error LNK2001: unresolved external symbol __imp__glTexParameteri@12 main.obj
Error 11 error LNK2001: unresolved external symbol __imp__glRotatef@16 main.obj
Error 12 error LNK2001: unresolved external symbol __imp__glVertex3f@12 main.obj
Error 13 error LNK2001: unresolved external symbol __imp__glMatrixMode@4 main.obj
Error 14 error LNK2001: unresolved external symbol __imp__glViewport@16 main.obj
Error 15 error LNK2001: unresolved external symbol __imp__glTranslatef@12 main.obj
Error 16 error LNK2001: unresolved external symbol __imp__glEnable@4 main.obj
Error 17 error LNK2001: unresolved external symbol __imp__glGenTextures@8 main.obj
Error 18 error LNK2001: unresolved external symbol __imp__glLoadIdentity@0 main.obj
Error 19 fatal error LNK1120: 18 unresolved externals



So i downloaded the glut lib found there : http://www.xmission.com/~nate/glut.html

I was surprising to see that the lib was very old (2001... !!!).

Then, i added this include to the code.

which redirect to what i downloaded.

#include <gl/glut.h>

And, miracle, the compilation works.

Is all i did is right ? Did i did anything wrong ?

Because when i stop the application, it crash.

I breakpoint the executation, i saw the error was after the main return.

If anybody has any idea ?

Thanks


Ps. I'm working with Seven and VisualStudio 2008

Pages: [1]
anything