OpenGL Texture not displaying - my first class.

Jones
Unregistered
 
Post: #31
Woops, yeah that was just a typing error, in my real code the class is in a seperate file from the main stuff.

Good for you, pointing that out, though. Smile

Do PNG's encode as BGRA, or RGBA? (Do then even have a standard set display mode?)

I'm guessing no, (to the set display mode), that would be too easy to be true.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #32
PNGs can be 8-bit (paletted), 8-bit (grayscale), 16-bit (paletted), 16-bit (grayscale), 24-bit (true color / 8 bits per channel), 32-bit (true color / 8 bits per channel / alpha), 48-bit (true color / 16 bits per channel) and 64-bit (true color / 16 bits per channel / alpha), IIRC. It also supports amusing features like compression, interlacing, and gamma correction.

If you're reading PNGs, you should be using libPNG (or another library which uses it indirectly). There is absolutely no reason to make your life a living hell by trying to write the code yourself.
Quote this message in a reply
Jones
Unregistered
 
Post: #33
OneSadCookie Wrote:PNGs can be 8-bit (paletted), 8-bit (grayscale), 16-bit (paletted), 16-bit (grayscale), 24-bit (true color / 8 bits per channel), 32-bit (true color / 8 bits per channel / alpha), 48-bit (true color / 16 bits per channel) and 64-bit (true color / 16 bits per channel / alpha), IIRC. It also supports amusing features like compression, interlacing, and gamma correction.

If you're reading PNGs, you should be using libPNG (or another library which uses it indirectly). There is absolutely no reason to make your life a living hell by trying to write the code yourself.

Well, it's not working, so I went back to Devil to see what I'd done to get TIFF's to work (partially). It tints my green helicopter pink if I force GL_RGBA or ask devil to tell GL what to use. If I force GL_BGRA it tints it blue. Hmm, I'm gonna blame this on photoshop and pixen. That will postpone the pain of realizing I'll have to get the libpng to work.

I'll go find some sample tiffs on the net to try out...


EDIT:
<laughs at something not even remotely funny>
HAHA!
</laughs at something not even remotely funny>

<exaggerates to vent rage>
It was Pixen all along! That lousy peice-o-smurf gong-show, bargain-mart trash software...
</exaggerates to vent rage>

Well, not quite. But that's the second format it encodes badly. Which is funny because every other app I try the image with it displays fine, I think it's the bit depth checking or something in DevIL. It expects me to specify the strange number of colors or something I'd guess, but I couldn't do that, because I had no idea that's how pixen saved it. That's my guess. Oh well, things are gonna start to work now, (finally) I hope.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #34
You might find that FreeImage works better than DevIL. Certainly I've used it without issue on Windows, Linux/x86, Mac OS X/ppc without issue, and the (very minor) bug that prevented it working on Mac OS X/x86 appears to be fixed.
Quote this message in a reply
Jones
Unregistered
 
Post: #35
OneSadCookie Wrote:You might find that FreeImage works better than DevIL. Certainly I've used it without issue on Windows, Linux/x86, Mac OS X/ppc without issue, and the (very minor) bug that prevented it working on Mac OS X/x86 appears to be fixed.

Ooh... alternatives. Blink Shock

Thanks, I'll try this out...
Quote this message in a reply
Jones
Unregistered
 
Post: #36
Sorry to bug all of you again.Blush

I used the makefile the build FreeImage. It completed the .a, but couldn't make the dylib. They're the same (but different) so no worries there. I know I just chuck the library into my xCode project, but I don't know what to include. The source didn't seem to come with any "include" directory, which might indicate the headers.

There are some FreeImage.h headers in the "source" folder, could those be them, or are they part of FreeImages actual source?

I'm pretty sure that's it. Bit strange that they chucked their def headers in with the actual source. I'll try sorting them out.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #37
IIRC, you just need the one "FreeImage.h" header.

It not building a dylib is probably a good thing Wink
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #38
If it's GPL, then making it a dynamic library (or framework) is necessary if you want to use it in a non-open source project.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #39
If it's GPL, building a dynamic library won't help Rasp
If it's LGPL, then yes, you'd need a dynamic library.

However, whilst it is available under the GPL, it is also available under its own very peculiar license which is much less restrictive.
Quote this message in a reply
Jones
Unregistered
 
Post: #40
Oh great, now I have to worry about licensing issues. Rasp

That's one of the reasons I like to use my own Code, it's mine. I couldn't tell you anything about GPL, other than the fact that it means Free Stuff. As far as I know, I'm allowed to for example, sell a game I made with a lib/framework as long as the creators say so, regardless of whatever GPL says on the subject, if anything.

Link to a copy of the original GPL?

And what's the difference between static and dynamic libraries? Static gets built into my program when I compile, and dylib is called up by the program from another location when it runs, correct?
Quote this message in a reply
Jones
Unregistered
 
Post: #41
Nevermind, I got off my lazy arse and found one. Grin

Now I'm gonna have to track down software specific licenses for API's I use...

EDIT: *Freedom* eh? Riigghhhttt... Rolleyes
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #42
OneSadCookie Wrote:If it's GPL, building a dynamic library won't help Rasp
If it's LGPL, then yes, you'd need a dynamic library.

However, whilst it is available under the GPL, it is also available under its own very peculiar license which is much less restrictive.
Thanks for the clarification. After seeing this, I checked all the libraries that I was planning on using for my stuff, and I'm happy to say that the most restrictive was under the LGPL. Smile
Quote this message in a reply
Jones
Unregistered
 
Post: #43
I've never been very good with legal junk, perhaps one could explain a few aspects of the GPL to me?

I can redistribute for example, I can modify <example GPL thing> (for example, stick it in a framework with some other stuff I wrote) and redistribute (for free) as long as I include the source to it, along with a list of the modifications (if any) I made to the <example GPL thing>?

What if I used <example GPL thing> to make a shareware appliction/game (something I wanted to sell) I could not, except charge for the fee of transffering it, or for a warranty.

What licenses are OpenGL and GLUT under? Huh

Aye... I have a feeling this is gonna get very complicated, very quickly.

But under GPL, I could modify/rebuild source for any <example GPL thing> and redistribute as it my "right"? Regardless of the what the orginal author says/wants?

Thanks!
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #44
OpenGL and GLUT are APIs, and therefore not under any license.

Apple's implementation of OpenGL and GLUT are under a license that allows you to use them for free without paying or acknowledging that you are using them in any way.. but you can't redistribute them, obviously.

The GPL means that you must always make the source freely available. It doesn't say anything about whether or not you can charge for pre-compiled versions of the software, or anything like that.

Your assets (textures, models, etc) will still be under your copyright.
Quote this message in a reply
Jones
Unregistered
 
Post: #45
OneSadCookie Wrote:OpenGL and GLUT are APIs, and therefore not under any license.

Apple's implementation of OpenGL and GLUT are under a license that allows you to use them for free without paying or acknowledging that you are using them in any way.. but you can't redistribute them, obviously.

The GPL means that you must always make the source freely available. It doesn't say anything about whether or not you can charge for pre-compiled versions of the software, or anything like that.

Your assets (textures, models, etc) will still be under your copyright.

Ahh, thanks! That's what I figured, but it says somewhere in there about all related assets of the program...

You'd just have to break the code enough to make it impossible for them to decode your license system. LOL
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL ES Texture Masking airfire 6 14,970 Mar 17, 2014 07:07 PM
Last Post: baioses
  OpenGL ES Texture Compression ajrs84 9 4,368 May 7, 2013 03:36 PM
Last Post: ajrs84
  OpenGL ES Texture Masking dalasjoe sin 0 3,887 Apr 13, 2012 12:17 AM
Last Post: dalasjoe sin
  Texture in OpenGL ES 2 looks pixelated vunterslaush 18 23,640 Aug 30, 2011 09:44 PM
Last Post: Frogblast
  Another beginner's question about displaying an animated object superlemonster 2 4,866 Jan 28, 2011 08:03 AM
Last Post: OptimisticMonkey