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

Pages: 1 [2] 3
16
Window / Windows .. Cursor-Changes .. only for a Moment visibly ..
« on: June 03, 2012, 09:47:56 am »
deleted

17
Window / sf::Style::None under Ubuntu(gcc) ..
« on: May 25, 2012, 08:21:04 pm »
deleted

18
Window / Please press F10 .. and no KeyReleased is coming up
« on: May 23, 2012, 03:50:50 pm »
deleted

19
Audio / Re: Memory released ..
« on: May 15, 2012, 11:12:12 am »
OK, but I have different ranges.
At this moment all things are working by me.
Thank you for the tip.

20
deleted

21
Audio / Re: Memory released ..
« on: May 10, 2012, 01:52:57 pm »
Yes, I need it for a std::vector<> array.
My questino: is it a memoryleak possible, when I do that?

22
Audio / Pitch and Duration ..
« on: May 10, 2012, 01:41:13 pm »
deleted

23
Audio / Memory released ..
« on: May 10, 2012, 01:37:41 pm »
deleted

24
Audio / getChannelsCount()
« on: May 08, 2012, 07:27:39 pm »
deleted

25
deleted

26
General / Re: Problem with 'Hello SFML'
« on: May 07, 2012, 11:19:00 am »
Sorry, my English is not good, unfortunately .. and nobody answers .. maybe I chose the wrong words.
Therefore, I transferred the question to german: http://forum.sfml-dev.de/index.php/topic,931.0.html and I will transfer my question also after system, too (look at: http://en.sfml-dev.org/forums/index.php?topic=7833.0).

27
General / Re: Problem with 'Hello SFML'
« on: May 06, 2012, 05:48:19 pm »

Download program: http://www.zwianer.de/Download/SFML_Lin32_ZwiAner
Any Problems are similar described like above reply!
I have a lot of new problems:
Examples:

Press the RAlt-Key .. event.key.code return 0 not 37.

The Button left next at Backspace:
Windows: Backcode=47 .. Ubuntu: Backcode=51 (an some times 0).
The next Button one more left:
Windows: Backcode=46 .. Ubunto: Backcode=0

Code 46 und 47 is described as LBracket/RBracket.
But the buttons are not at the right place at english keyboard (my opinion).

etc.

I am a little confused ..  :o .. please help me.

28
General / Re: Problem with 'Hello SFML'
« on: May 04, 2012, 03:45:33 pm »
Win7/64, VS2010: My first 'game' with SFML (only a 'joke'). I am testing the keyboard input:
Hint: Later in my planned game will i have a framerate=30 >> ::sleep(33);.
Code: [Select]
#include "stdafx.h"
#ifdef _WIN32
  int APIENTRY _tWinMain
               (
                 HINSTANCE hInstance,
                 HINSTANCE hPrevInstance,
                 LPTSTR lpCmdLine,
                 int nCmdShow
               )
#else
  int main(void)
#endif
{
  #ifdef _DEBUG 
    sf::RenderWindow window(sf::VideoMode(950, 150), "SFML works!");
  #else
    //sf::RenderWindow window(sf::VideoMode::getDesktopMode(), "SFML works!", sf::Style::Fullscreen);
    sf::RenderWindow window(sf::VideoMode(950, 150), "SFML works!");
  #endif

  sf::Text txtS("Hello SFML");

  #ifdef _WIN32
    std::string sFnt = std::getenv("WINDIR");  //> Warnung unterdrücken: 4996;:
    sFnt += "\\Fonts\\COUR.TTF";

    sf::Font k_Font;
    if (!k_Font.loadFromFile(sFnt))
    {
      txtS.setString("FontFehler");

    }
  #else
    std::string sFnt = "/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf" ;
    //std::string sFnt = "/usr/share/fonts/truetype/ttf-liberation/LiberationMono-Bold.ttf" ;
    sf::Font k_Font;
    if (!k_Font.loadFromFile(sFnt))
    {
      txtS.setString("FontFehler");
     
    }
  #endif

  sf::Text txtK("");   //> Zeig TastaturStatus:
  txtK.move(20.0, 50.0);
  txtK.setScale(0.5, 0.5);
  txtK.setFont(k_Font);

  sf::Text txtM("");   //> Markiere einige Tasten:
  txtM.move(20.0, 70.0);
  txtM.setScale(0.5, 0.5);
  txtM.setFont(k_Font);

  sf::Text txtZ("");   //> Markiere Zusatzinfo:
  txtZ.move(20.0, 90.0);
  txtZ.setScale(0.5, 0.5);
  txtZ.setFont(k_Font);

  sf::Text txtC("");   //> Codeinfo:
  txtC.move(20.0, 110.0);
  txtC.setScale(0.5, 0.5);
  txtC.setFont(k_Font);

  sf::Event k_Event;
  window.setKeyRepeatEnabled(true);

  const long k_lKc = sf::Keyboard::KeyCount;
  long k_KeyTst[k_lKc];
  long i = 0;

  //> TastaturStatus=0:
  for (i = 0; (i < k_lKc); i++)
  {
    k_KeyTst[i] = 0;
 
  }

  while (window.isOpen())
  {
    //> EVENTS:

    while (window.pollEvent(k_Event))
    {             
      if
      (
        (k_Event.type == sf::Event::LostFocus)
        ||
        (k_Event.type == sf::Event::GainedFocus)     
        ||
        (k_Event.type == sf::Event::Resized)
      )
      {
        //> TastaturStatus=0:
        for (i = 0; (i < k_lKc); i++)
        {
          k_KeyTst[i] = 0;
 
        }

      }
     
      //> Eine oder mehrere Tasten gedrückt:
      if (k_Event.type == sf::Event::KeyPressed)       
      {
        long lKyC = k_Event.key.code;

        if
        (
          (lKyC > -1)
          &&
          (lKyC < k_lKc)
        )
        {
          if (k_KeyTst[lKyC] < LONG_MAX)
          {
            k_KeyTst[lKyC]++;

          } else
          {
            k_KeyTst[lKyC] = 1;

          }
        }
      }

      //> Eine oder mehrere Tasten losgelassen:
      if (k_Event.type == sf::Event::KeyReleased)       
      {
        long lKyC = k_Event.key.code;

        if
        (
          (lKyC > -1)
          &&
          (lKyC < k_lKc)
        )
        {
          k_KeyTst[lKyC] = 0;

        }
      }

      if (k_Event.type == sf::Event::Closed)
      {
        window.close();   //> Und raus ..:

      }
    }

    std::string sTxtK;  //> TastaturZustand: "_" | "1" .. "9", "X":
    sTxtK = "";
    std::string sTxtM;  //> Markierung einiger Tasten:
    sTxtM = "";
    std::string sTxtZ;  //> Zusatzbemerkung zu einigen Tasten:
    sTxtZ = "";
    std::string sTxtC;  //> TastenKeyCode:
    sTxtC = "KeyCode =";

    for (i = 0; (i < k_lKc); i++)
    {
      if (k_KeyTst[i] > 0)
      {
        //> Taste ist gedrückt:

        char cX[256];

        if (k_KeyTst[i] < 10)
        {
          #ifdef _WIN32
            _itoa_s(k_KeyTst[i], cX, 256, 10);
          #else
            sprintf(cX, "%ld", k_KeyTst[i]);
          #endif 

          sTxtK += cX;   //> "1" .. "9":

        } else
        {
          sTxtK += "X";

        }

        sprintf(cX, " %ld", i);
        sTxtC += cX;

      } else
      {
        //> Taste ist nicht gedrückt:

        sTxtK += "_"; 
 
      }

      //> Markierungen:

      switch (i)
      {
        case sf::Keyboard::A:
        {
          sTxtM += "A";
          sTxtZ += " ";
          break;
        }

        case sf::Keyboard::B:
        {
          sTxtM += "B";
          sTxtZ += " ";
          break;
        }

        case sf::Keyboard::K:
        {
          sTxtM += "K";
          sTxtZ += " ";
          break;
        }

        case sf::Keyboard::L:
        {
          sTxtM += "L";
          sTxtZ += " ";
          break;
        }

        case sf::Keyboard::LAlt:
        {
          sTxtM += "a";
          sTxtZ += "L";
          break;
        }

        case sf::Keyboard::RAlt:
        {
          sTxtM += "a";
          sTxtZ += "R";
          break;
        }

        case sf::Keyboard::LControl:
        {
          sTxtM += "c";
          sTxtZ += "L";
          break;
        }

        case sf::Keyboard::RControl:
        {
          sTxtM += "c";
          sTxtZ += "R";
          break;
        }

        case sf::Keyboard::LBracket:
        {
          sTxtM += "[";
          sTxtZ += " ";
          break;
        }

        case sf::Keyboard::RBracket:
        {
          sTxtM += "]";
          sTxtZ += " ";
          break;
        }
         
        default:
        {
          sTxtM += " ";
          sTxtZ += " ";
          break;
        }
      }       
    }

    txtK.setString(sTxtK);
    txtM.setString(sTxtM);
    txtZ.setString(sTxtZ);
    txtC.setString(sTxtC);

    window.clear();

    window.draw(txtS);       
    window.draw(txtK);
    window.draw(txtM);
    window.draw(txtZ);
    window.draw(txtC);

    window.display();

    #ifdef _WIN32
      Sleep(33);
    #else
      usleep(33);
    #endif

  }
  return 0;
}
Download the *.exx: http://www.zwianer.de/Download/SFML_Win32_ZwiAner.exx and rename to *.exe.
Example K-Key:

Press and hold the K-key .. when released then is the statusline again empty .. just like I wants.
There a 3 problems:
a) LAlt-Key:

Press and hold the LAlt-Key .. when released (in most cases) no effect! (You must press another Key to 'released' the LAlt-Key.)
b) RAlt-Key:

Press and hold the RAlt-Key .. the LControl appear at the same time!
c) K-Key and L-Key (at the same time):

Press the K-Key for a second .. hold it .. and press the L-Key additional.
Only the second key is updated as 'pressed'.
In a few cases (when pressed both at same time) .. both Key are updated as 'pressed'.

29
General / Re: Problem with 'Hello SFML'
« on: May 04, 2012, 10:15:24 am »
From Windows. I altered the code to:
Code: [Select]
  std::string sFnt = std::getenv("WINDIR");
  sFnt += "\\Fonts\\COUR.TTF";
  sf::Font k_Font;
  //if (!k_Font.loadFromFile("COUR.TTF"))
  if (!k_Font.loadFromFile(sFnt))
  {
    txtS.setString("FontFehler");
  }
In this case, it works. (I thought that Fonts always are loaded there without path statement ::))

30
General / Re: Problem with 'Hello SFML'
« on: May 04, 2012, 09:25:41 am »
Code: [Select]
sf::Font MyFont;
// Load from a font file on disk
if (!MyFont.LoadFromFile("arial.ttf"))
{
    // Error...
}
If I go right in the assumption that the full path always must be used? (Win7/64, VS2010)
In the above form, it doesn't work with me.

Pages: 1 [2] 3