The programm load and display the image, but the size of the image isn´t correct.I work with a 800x600 fullscreen mode, and the image is 32x32 in size, but the program scaled the image about half of the screen!?I dont scaled it or do any other transformations, just use the code about.
Does anyone know what i do wrong, or have a c++ example for display 2d images?
I tried the forum search(like many times before), but i found nothing about this problem).
This is normal behaviour, that you can expect in any 3D engine. The texture coordinates are always transformed to 0…1 range.
If you don’t want this, reparent it to pixel2d and set the scale appropriately (to 32, 32 probably). But you probably don’t want that either, because that means that when your window is rescaled, your image won’t rescale with it. So you’ll probably just want to scale down the cursor image uniformly.
This is the “usual” way to show images in a 3D engine. I don’t think pixel2d is available in C++ at the moment, so you’ll need to manually rescale your texture to make the size on the screen be 32x32.