Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Mi Jul 16, 2025 21:33

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 7 Beiträge ] 
Autor Nachricht
BeitragVerfasst: Do Okt 22, 2009 19:07 
Offline
DGL Member

Registriert: Do Sep 04, 2008 11:30
Beiträge: 7
Wohnort: England
It looks like I need to load PNG files into textures (I suspect that I need a transparent textures to achive the look I want). I know how to load BMP or JPEG files, is there something similar for PNG?

The effect I want to achieve is something similar to NeHe Lesson 9 (I haven't worked out how to include images here), coloured glowing disks with radial streaks that fade to the tips moving about. But these fancy disks need to be specific colours, moving on any coloured background. Using single texture and glBlendFunc(GL_ONE, GL_ONE) works for coloured disks on a black background, or white disks on any colour, but of course colour on colour gets blended.

My card is too ancient to handle point sprites (which may or may not have helped). Is texture with alpha channel data the way to go? I haven't managed to create a transparent texture yet to know for sure. Any suggestions?


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Okt 22, 2009 21:35 
Offline
DGL Member
Benutzeravatar

Registriert: Di Sep 20, 2005 13:18
Beiträge: 1054
Wohnort: Dresden
Programmiersprache: C, C++, Pascal, OPL
I use SDL_Image for Loadings Images.
I use only transparent pngs for my applications.

_________________
Denn wer nur schweigt, weil er Konflikte scheut, der macht Sachen, die er hinterher bereut.
Und das ist verkehrt, denn es ist nicht so schwer, jeden Tag zu tun als ob's der letzte wär’.
Und du schaust mich an und fragst ob ich das kann.
Und ich denk, ich werd' mich ändern irgendwann.

_________________Farin Urlaub - Bewegungslos


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Okt 22, 2009 22:27 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
FreeImage is good at loading multiple file formats. It has a Delphi wrapper.

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Okt 23, 2009 09:17 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 29, 2003 00:11
Beiträge: 436
In a C++-Project, I used PicoPNG. Very small and nice. :)
http://members.gamedev.net/lode/projects/LodePNG/


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Okt 23, 2009 09:58 
Offline
DGL Member
Benutzeravatar

Registriert: Do Sep 02, 2004 19:42
Beiträge: 4158
Programmiersprache: FreePascal, C++
If you are working with Delphi and you are willing to replace your code with a larger library, I can recommend the glBitmap by Lossy eX. It is object oriented, supports multiple backends to load some formats and is quite fast, even with large images.

greetings

_________________
If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung.
current projects: ManiacLab; aioxmpp
zombofant networkmy photostream
„Writing code is like writing poetry“ - source unknown


„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Okt 24, 2009 11:19 
Offline
DGL Member

Registriert: Do Sep 04, 2008 11:30
Beiträge: 7
Wohnort: England
Thanks for the suggestions, but this is turning out more complicated than I initaily thought. Just how hard can making a transparent texture be?

I don't really want to use the SDL library, overkill for my 2D app, so that rules out SDL_image (I think). My C is pretty rusty too, and the compressed code style of PicoPNG just made my head hurt when I considered writing a Delphi equivalent. So I am looking between glBitmap and FreeImage.

Google translator from German to English didn't make much sense of the glBitmap pages, but I think my issue here is getting the right DLLs to support the loadPNG library that it uses. The loadPNG site doesn't seem to offer a download, so not sure how to get this working either. I think I have figured out how to use FreeImage to build a texture, so I guess that will be how I go.

Meanwhile I have tried making a transparent texture programmatically, but this is not rendering as I expected either. Is it possible to render a single texture, that is transparent in places, in different colours? That is some red fussy disks here, blue there and all uneffected by background colour. Seems that when I blend for the transparency, the colour of the texture has to blend too.

Some more help would be greatly apprectated.


Zuletzt geändert von Dave Blake am Sa Okt 24, 2009 12:03, insgesamt 1-mal geändert.

Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Okt 24, 2009 11:59 
Offline
DGL Member
Benutzeravatar

Registriert: Do Sep 02, 2004 19:42
Beiträge: 4158
Programmiersprache: FreePascal, C++
I see, you have a problem with the german descriptions. So to use glBitmap for loading png images, you just need the libpng.dll *or* you can even go without any dll by using the pngimage.pas which should be findable using google.
Which variant is to be used is decided by the compiler directives in the head part of the glBitmap.pas. There you also find english descriptions.

good luck & greetings

_________________
If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung.
current projects: ManiacLab; aioxmpp
zombofant networkmy photostream
„Writing code is like writing poetry“ - source unknown


„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 7 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.008s | 16 Queries | GZIP : On ]