Jump to content
Tuts 4 You

[C++/OpenGL] using a texture that has a transparent color (A snowflake texture)


Recommended Posts

Hii! i am almost about to release my first old-school intro with some friends! the only thing left is to know how to bind textures to a quad

i am working with opengl 1.1 as much as i can, for this intro to work on old windows/old integrated graphic chips, so i want to avoid libraries and do it as vanilla as posible also to learn from it! = p

i created a new opengl template in Code::Blocks to work in a cleaner environment, the code is as follow:


which output this nice square on the screen:

BUT instead i want to use this nice snowflake:

and since afaik i can't use png files without a library, here is the 24 bits bmp version with #FF00FF (glColor3f(1.0f, 0.0f, 1.0f);) background instead:

i attached the project folder here, i use the Code::Blocks; and has it's project file in

i have read the opengl 1.1 red book and the 1.1 super bible respective sections, seek dbf and this forum for help i dig on 500 threads there [https://i.imgur.com/34kbxio.png] lol = p and can't find my solution

can someone help me with what to do to bind the snowflake texture to the quad, and it to show with it's color transparent?

thanks you so much before hand! the release of this oldschool intro is stuck by this, i appreciate any help! x3


Edited by ViLXDRYAD
Link to comment

i found the solution! huge thanks to a very cool fellah named Knurz! :D

i am now using UPNG to load png textures! https://github.com/elanthis/upng

now it shows a nice snowflake on the screen! x3

BUT after some messing around trying to use a second snowflake texture, i couldn't find my way to use other texture than the first, this is the code:


how can i set another texture with its own id? =' 3 it is the only thing left to beat to actually have everything that is left on the intro! x3 and my bad for asking too much :c i effort on make my "homework" before asking anything, and really have a hard time figuring out this, i'll appreciate any idea!~ x3

Edited by ViLXDRYAD
Link to comment

The point of my question is to help you with what I know, openGL is deep and even basic scenes require

some knowledge about several topics, but once you learn the basics your performance will accelerate.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...