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

Pages: 1 [2] 3 4 ... 10
16
General / OpenGL - Question concerning Image::bind() a bit
« on: January 15, 2010, 11:37:28 am »
here u can see a screenshot, i hope u can understand my problem now


http://mstg.bplaced.net/Bildschirmfoto1.png

17
General / OpenGL - Question concerning Image::bind() a bit
« on: January 15, 2010, 11:02:55 am »
Hello, i wanted to create a billard-ball with a texture,

thats the code:

Code: [Select]

    GLUquadricObj* quadric;

    sf::Image img;
    img.LoadFromFile("10ball.jpg");
    img.Bind();
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {

        }

        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);


        quadric = gluNewQuadric();
        //gluQuadricNormals(quadric, GLU_SMOOTH);
        gluQuadricTexture(quadric, GL_TRUE);
        gluSphere(quadric, 30.0, 1000, 500);

        App.Display();
    }


but i can see the border of the texture.

Someone told me that cube-mapping might help.

I didnt really find out how i could do this, can someone help me?

It seems that Bind() decides the way it is mapped, what is standard and how can i change it?

18
Graphics / sf::Image::bind()
« on: December 16, 2009, 04:19:50 pm »
one last question concerning this topic:

how do i use different textures for eg one cube?

bind doesnt seem to work in glBegin() ... glEnd(),
so by now i have to split one cube in 6 calls, so that i can bind another image.

but id like to use something (like with colors) like that:

glBegin(Quads or so)
 img.Bind()
 texturecoord, vertex;
 texturecoord, vertex;
 texturecoord, vertex;
 texturecoord, vertex;
another_img.bind()
 texturecoord, vertex;
 texturecoord, vertex;
 texturecoord, vertex;
 texturecoord, vertex;
glEnd();

by now its like:

img.bind();
glBegin()
...
glEnd()

another img.bind();
glBegin()
...
glEnd();

19
Graphics / sf::Image::bind()
« on: December 16, 2009, 01:51:49 pm »
Yeah, thank you.

256*256 does work exactly the way i wnat it to do.

But is there any way t disable padding?
I dont want to scale every Picture id like to use for textures to 256*256.

But if there is no other way...


Well at least it works =)

20
Graphics / sf::Image::bind()
« on: December 16, 2009, 01:34:09 pm »
the texture is a picture i downloaded from the internet,

it is scaled to 300*300 px by default (i sometimes change it to see what happens)

the texture appears, so i think that my g-card doesnt have problems with textures.
And the regions not textured appear black, not white

(to see them i changed glearcolor to red)

...
is there some mistake in my code?

i tried even different formats, eg jpg, bmp

(when trying jpg, i sometimes get strange errors (Bad Drawable oder Window-Parameter)
but even with bmp the texture is incomplete but i didnt get any error yet

any idea whats going wrong?

21
Graphics / Can anyone tell me why it doesnt work?
« on: December 16, 2009, 01:04:37 pm »
Well here is my second attempt to get a texture working:

Code: [Select]




////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <iostream>


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

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

    // Set color and depth clear value
    glClearDepth(1.f);
    glClearColor(1.f, 0.f, 0.f, 0.f);

    // Enable Z-buffer read and write
    glEnable(GL_DEPTH_TEST);
    glDepthMask(GL_TRUE);

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

    sf::Image img;
    if(!img.LoadFromFile("/home/anubis/Bilder/holz.jpg"))
        std::cout << "Error while loading Image\n";

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();

            // Escape key : exit
            if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
                App.Close();

            // Resize event : adjust viewport
            if (Event.Type == sf::Event::Resized)
                glViewport(0, 0, Event.Size.Width, Event.Size.Height);
        }

        // Set the active window before using OpenGL commands
        // It's useless here because active window is always the same,
        // but don't forget it if you use multiple windows or controls
        App.SetActive();

        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);


        // Apply some transformations
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();
        glTranslatef(0.f, 0.f, -200.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);

        img.Bind();
       
        glPushMatrix();
        glScalef(20,20,20);

            glBegin(GL_QUADS);
                glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0, 0.0);
                glTexCoord2f(0.0, 1.0); glVertex3f(-1.0, 1.0, 0.0);
                glTexCoord2f(1.0, 1.0); glVertex3f(1.0, 1.0, 0.0);
                glTexCoord2f(1.0, 0.0); glVertex3f(1.0, -1.0, 0.0);

            glEnd();

        glPopMatrix();

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

    return EXIT_SUCCESS;
}


but my texture doesnt fit the whole square... why is it so?
even when i scale my texture up to 2000^2 pixels the texture doesnt seem complete.

All i want to see is my square with wooden surface ^^

And if .bind() does the same like id do using pure opengl, where can i put extra-options?
[ glTexParameterf(xxx)  ?]

im sorry that i dont post sfml-relevant stuff only, but i want to use it for a (very small) opengl-project

(scenegraph-rendering and collada im/export)

22
Graphics / sf::Image::bind()
« on: December 15, 2009, 04:27:24 pm »
Hello, I´m wondering what the bind() - function exactly does.
Background: I´d like to use sfml for creating OpenGL-textures.

But yet i do not understand what the bind() does.

Are there any restrictions for a texture-image?
E.g. should it be quadratic? Or from the other side:
What is a bad texture-image?

23
General discussions / OpenGl 3.x
« on: November 10, 2009, 04:20:12 pm »
In the german forum someone said that sfml isn compatible to opengl 3.x,

is that true?
and if so, will that change?

24
General discussions / SETTING UP
« on: October 22, 2009, 02:29:00 pm »
Can someone post me how to set-up sfml with qt creator??

i did the following:

I downloaded the 64-bit version of SFML and extracted to the Folder SFML

now i started a qt-creator console  project

with the tutorial code:

Code: [Select]

#include <SFML/System.hpp>
#include <iostream>

int main()
{
    sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }

    return 0;
}


i added the path to lib and include
my pro file looks like that:

Code: [Select]


i hope someone will help me
QT          -= gui

TARGET       = sfmll
CONFIG      += console
CONFIG      -= app_bundle

TEMPLATE     = app


SOURCES     += main.cpp

LIBS        += /home/kleopatra/SFML/lib -lsfml-system
INCLUDEPATH += /home/kleopatra/SFML/include


25
General discussions / Not really related to SFML
« on: October 22, 2009, 08:10:07 am »
Hi guys,
here i am again to ask for some help.

I'm using Code::Blocks on Kubuntu.
Setting up SFML was no big Problem, the tutorial on it is really great.
But now i wanted to start to integrate QT4, too.

ANd here the problems start.

I'm quite new to Linux and installed all Qt (-dev) packages I will need using the package manager synaptic.

Now I want to create a QT - Project, but i don't know
a) where the folder containing /lib and /include is located
b) what linker options i have to do manually

Moreover:
I'll try out QTCreator which has been recommended to me.

Though I didnt even try yet, I'm somehow sure I'll have some Problems linking SFML again...

Where can I take a  crash course to learn what I have to do, no matter what IDE I choose?

I've seen that

g++ -o out  -lLIBRARY -L../lib file.cpp

seems to be some standard operation,

but where are the /includes ?

I'm glad for any explanation or good link (meaning: should be intelligible for a total beginner )

thnx- the ravenhearted

26
General discussions / Java
« on: May 21, 2009, 01:25:09 pm »
One question :

Is there a real probability that someone writes a java-wrapper for sfml??

i really like sfml but much of my code is java and i dont like java2d

27
General / sfml download
« on: March 02, 2009, 05:39:20 pm »
finally.. it seems here lies the problem:

glxgears is NOT running, it is the same error message like i posted before,

what is missing in my system??

28
General / sfml download
« on: March 02, 2009, 05:06:33 pm »
if u mean

make sfml or make sfml-samples , i already did it -> tat lkeads to following output when i try to run samples or my own files:

Quote

X Error of failed request:  BadRequest (invalid request code or no such operation)
  Major opcode of failed request:  143 (GLX)
  Minor opcode of failed request:  19 (X_GLXQueryServerString)
  Serial number of failed request:  14
  Current serial number in output stream:  14

29
General / sfml download
« on: March 02, 2009, 11:06:52 am »
how can i recompile it ?!

30
General / sfml download
« on: March 01, 2009, 06:43:06 pm »
yes i use 64 bit

how can i use sfml with my 64-bit os??
the files i create cannot be opened too, even when compiling and linking worked, then i get this msg:

Quote

localhost:/home/kleopatra/Dokumente # ./test
./test: error while loading shared libraries: libsfml-system.so.1.4: cannot open shared object file: No such file or directory

Pages: 1 [2] 3 4 ... 10