Partage
  • Partager sur Facebook
  • Partager sur Twitter

[SFML­] charger une image

internal size too hig

Sujet résolu
    3 mars 2008 à 5:46:26

    salut, j'ai un petit probleme concernant la creation d'image avec la SFML....je n'ai ajamis eu cette erreur et ca fait plusieurs fois que j'utilise les memes images et ils marchaient avant... :(
    (heuu voici le code...)
    1. #include <iostream>
    2. #include <SFML/System.hpp>
    3. #include <SFML/Graphics.hpp>
    4. using namespace std;
    5. int main()
    6. {
    7.     sf::Image image;
    8.     sf::Sprite sprite;
    9.     image.LoadFromFile("hello.png");
    10.     return 0;
    11. }

    ca fait un bout j'ai pas programmer, j'ai p-e fait une erreur (impossible :p )
    TOUT compile, mais erreur! failed to creat image, its internal size is too hig (35x64)
    alors que l'image est une 35 x 35 pixel...WTF ?!
    • Partager sur Facebook
    • Partager sur Twitter
      3 mars 2008 à 6:02:49

      Que vaut le retour de sf::OpenGLCaps::GetMaxTextureSize() si tu l'affiches ?
      • Partager sur Facebook
      • Partager sur Twitter
        3 mars 2008 à 18:41:29

        1. #include <iostream>
        2. #include <SFML/System.hpp>
        3. #include <SFML/Graphics.hpp>
        4. using namespace std;
        5. int main()
        6. {
        7.     sf::Image image;
        8.     image.LoadFromFile("hello1.png");
        9.     cout << endl << endl;
        10.     cout << sf::OpenGLCaps::GetMaxTextureSize();
        11.     return 0;
        12. }


        Failed to create image, it's internal size is too high (50x64)
        4
        Process returned 0 blablabla...

        La j'ai essayer avec une autre image que j'ai ripper d'une sprite sheet que javais deja auparavant...elle est "neuve"(png) . Même chose avec un jpg que je vien de ripper d'internet.
        • Partager sur Facebook
        • Partager sur Twitter
        Anonyme
          3 mars 2008 à 18:49:55

          C'est quoi ta CG? (C'est pas "bizarre" une taille max de 4???)
          • Partager sur Facebook
          • Partager sur Twitter
            4 mars 2008 à 2:10:30

            Même question : quelle est ta config ? Tes drivers sont-ils à jour ? Arrives-tu à faire tourner d'autres applications OpenGL ?
            • Partager sur Facebook
            • Partager sur Twitter
              4 mars 2008 à 5:08:23

              heuu....oui oui et oui....je joue a des assez recent
              2.8 ghz intel p4
              geforce 7600 gs
              762 mb de ram ddr...ou un chiffre bizzare comme ca...
              je crois qu'avec une taille reelment "maximum" de 4 ma config n'arriverais meme pas a faire tourner firefox non?
              pour faire tourner des application recentes opengl, je crois que je pourrais classifier le source engin la dedans...et je joue half-life 2 avec d'assez beau graphiques...
              • Partager sur Facebook
              • Partager sur Twitter
              Anonyme
                4 mars 2008 à 13:10:02

                Essaye de télécharger un exemple utilisant que OGL (et pas DX comme HL2).
                • Partager sur Facebook
                • Partager sur Twitter
                  4 mars 2008 à 17:09:56

                  Je cherche...je cherche :-°
                  tu crois vraiment qu'avec ma config (et ouioui...j'ai bin les derniers nforces...)
                  j'aurais un probleme avec opengl...? c'est un peu absurde...

                  j'ai telechargé ce code (j'ai testé le exe sans le compiler...je n'ai pas glut)
                  et le triangle s'affiche bien
                  1. //------------------------------------------------------------
                  2. /// \file       Main.cpp
                  3. /// \author     Rob Bateman
                  4. /// \date       9-feb-2005
                  5. /// \brief      This is a really simple example of using glut and
                  6. ///             rendering basic primitives.
                  7. //------------------------------------------------------------
                  8. #include <stdlib.h>
                  9. #include <GL/glut.h>
                  10. //------------------------------------------------------------  OnReshape()
                  11. //
                  12. // This function is called when the window gets resized. It
                  13. // allows us to set up the camera projection for the scene.
                  14. //
                  15. void OnReshape(int w, int h)
                  16. {
                  17.         // set the drawable region of the window to the maximum
                  18.         // available window size
                  19.         glViewport(0,0,w,h);
                  20.         // set up the projection matrix
                  21.         glMatrixMode(GL_PROJECTION);
                  22.         // clear any previous transform and set to the identity matrix
                  23.         glLoadIdentity();
                  24.         // just use an orthographic projection
                  25.         glOrtho(-12,12,-12,12,-1,1);
                  26.         // go back to modelview matrix so we can move the objects about
                  27.         glMatrixMode(GL_MODELVIEW);
                  28. }
                  29. //------------------------------------------------------------  OnDraw()
                  30. //
                  31. // glut will call this function whenever the window needs to be
                  32. // redrawn.
                  33. //
                  34. void OnDraw() {
                  35.         // clear the screen & depth buffer
                  36.         glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
                  37.         // clear the previous transform
                  38.         glLoadIdentity();
                  39.         //
                  40.         // The simplest way to render geometry within openGL is to use
                  41.         // whats known as immediate mode. The drawing takes place between
                  42.         // glBegin() and glEnd(). glBegin takes the type of geometry you
                  43.         // want to draw, these can be on of the following :
                  44.         //
                  45.         //      GL_POINTS
                  46.         //      GL_LINES
                  47.         //      GL_LINE_LOOP
                  48.         //              GL_LINE_STRIP
                  49.         //      GL_TRIANGLES
                  50.         //      GL_TRIANGLE_STRIP
                  51.         //      GL_TRIANGLE_FAN
                  52.         //      GL_QUADS
                  53.         //      GL_QUAD_STRIP
                  54.         //      GL_POLYGON
                  55.         //
                  56.         // You can place as many calls to glVertex3f inbetween glBegin() and
                  57.         // glEnd(). For example, 6 calls to glVertex* between glBegin and glEnd
                  58.         // would produce 2 triangles....
                  59.         //
                  60.         glBegin(GL_TRIANGLES);
                  61.                 glColor3f(1,0,0);
                  62.                 glVertex3f(-10,-10,0);
                  63.                 glColor3f(0,1,0);
                  64.                 glVertex3f(10,-10,0);
                  65.                 glColor3f(0,0,1);
                  66.                 glVertex3f(0,10,0);
                  67.         glEnd();
                  68.         // currently we've been drawing to the back buffer, we need
                  69.         // to swap the back buffer with the front one to make the image visible
                  70.         glutSwapBuffers();
                  71. }
                  72. //------------------------------------------------------------  OnInit()
                  73. //
                  74. void OnInit() {
                  75.         // enable depth testing
                  76.         glEnable(GL_DEPTH_TEST);
                  77. }
                  78. //------------------------------------------------------------  OnExit()
                  79. //
                  80. void OnExit() {
                  81. }
                  82. //------------------------------------------------------------  main()
                  83. //
                  84. int main(int argc,char** argv) {
                  85.         // initialise glut
                  86.         glutInit(&argc,argv);
                  87.         // request a depth buffer, RGBA display mode, and we want double buffering
                  88.         glutInitDisplayMode(GLUT_DEPTH|GLUT_RGBA|GLUT_DOUBLE);
                  89.         // set the initial window size
                  90.         glutInitWindowSize(640,480);
                  91.         // create the window
                  92.         glutCreateWindow("A basic primitive example");
                  93.         // set the function to use to draw our scene
                  94.         glutDisplayFunc(OnDraw);
                  95.         // set the function to handle changes in screen size
                  96.         glutReshapeFunc(OnReshape);
                  97.         // run our custom initialisation
                  98.         OnInit();
                  99.         // set the function to be called when we exit
                  100.         atexit(OnExit);
                  101.         // this function runs a while loop to keep the program running.
                  102.         glutMainLoop();
                  103.         return 0;
                  104. }
                  • Partager sur Facebook
                  • Partager sur Twitter
                    1 avril 2008 à 3:39:57

                    un petit up qui perdure malgré un formatage
                    Ca me fais vraiment chier tabarnak d'osti dcaliss...



                    PROBLEME RESOLU

                    je n'avais pas creer de renderWindow...
                    je me rappel je ne voulais que tester deux trois chose sans fenetre et je ne comprenais pas pourquoi ca ne fonctionnais pas
                    Je ne comprend PAS pourquoi ca ne marche pas sans window, mais c'est CA LE PROBLEME!
                    • Partager sur Facebook
                    • Partager sur Twitter

                    [SFML­] charger une image

                    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
                    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
                    • Editeur
                    • Markdown