Search found 484 matches

by tunginobi
Jun 16, 2007 5:13
Forum: Libraries Questions
Topic: openGL textures and FB
Replies: 12
Views: 7333

Change this: '' generate texture glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, wid, hgt, 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer) to this: '' generate texture glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, wid, hgt, 0, GL_BGR, GL_UNSIGNED_BYTE, buffer) Untested, but the same technique has worked in my C++ projects....
by tunginobi
May 17, 2007 10:17
Forum: Beginners
Topic: recursive functions?
Replies: 3
Views: 2630

Yes, functions can call themselves, and yes, what you're asking is very possible. Turn your sub into a function that returns an integer. At the beginning of the function, declare a local integer, init that to zero. At each recursive function call inside your recursive function, add the return value ...
by tunginobi
Mar 11, 2007 10:02
Forum: Game Dev
Topic: using GETJOYSTICK
Replies: 5
Views: 3926

Don't check equality for floating point values (i.e. single and double). That's just asking for trouble. Instead, test for numbers very close to your desired value, in a range, using inequality operators.
by tunginobi
Mar 06, 2007 1:58
Forum: Beginners
Topic: math operations with array pointers
Replies: 11
Views: 4348

If you have a better answer then post it. But your response is pretty clueless to me. No seriously, next time you have a problem, you should copy-paste the code as is. Adapted versions can inadvertently introduce self-corrections, and then we're left wondering why the code sample works, but the cod...
by tunginobi
Mar 04, 2007 7:20
Forum: Beginners
Topic: math operations with array pointers
Replies: 11
Views: 4348

Thanks for the replies. This code works, it is a little messy and not-so-optimal but does the work. So my guess is that FB likes to know the upper and lower bounds of the arrays (like its own descriptor is set)? Nope. It just means you screwed up with the first code sample, though I've got nothing ...
by tunginobi
Mar 03, 2007 2:12
Forum: General
Topic: Any other debuggers?
Replies: 10
Views: 2788

Electric fence will wrap around calls to malloc() and other related functions in C. -lefence is sufficient, but I've never tried it with FB. What it does is place "fence blocks" around every memory allocation, so it can tell when you're accessing stuff outside of where you should. Never tr...
by tunginobi
Feb 27, 2007 23:07
Forum: Linux
Topic: Integrating GfxLib with Gtk
Replies: 14
Views: 13690

You are seeing the color problems, right? The order of the bytes in the screen buffer still need to be worked out. Maybe it would be nice if ScreenRes could allow you to tweak the byte order, say to just make it RRRRGGGGBBBB, instead of some 4-byte thing that the 24-bit screen defaults too. Yeah, I...
by tunginobi
Feb 27, 2007 5:58
Forum: Linux
Topic: Integrating GfxLib with Gtk
Replies: 14
Views: 13690

Very nice! Got it working after a few tweaks: 1. The forum [ code ] tags have changed SYSTEM into System and name= to Name in the Glade XML file. 2. In two places in the source, you refer to "drawingarea", but the widget is named "drawingarea1". 3. You haven't written the impleme...
by tunginobi
Feb 22, 2007 0:51
Forum: Beginners
Topic: Pointer as an formula. (solved)
Replies: 9
Views: 2857

Since those pointers have to maintained somehow, they need to go into a class or type. Knowing stuff about classes, but nothing about classes in FB, the following code is purely theoretical and should be fixed by somebody who knows what they're doing: '' UNTESTED THEORETICAL FB CODE ''*** Pseudo cla...
by tunginobi
Feb 22, 2007 0:21
Forum: Beginners
Topic: Static array of pointer on static array ... how to ?
Replies: 6
Views: 1991

Well, there's good news and there's bad news. The bad news is that AFAIK, once you turn to pointers, you lose FB's nice array information. To find out if you're at the end of an array, you'll need to use either a sentinel value, or define a wrapper type with a length. FB's pointers most closely mimi...
by tunginobi
Feb 21, 2007 21:59
Forum: General
Topic: Windows API: How do I call it?
Replies: 13
Views: 4298

@Skyler: Timer resolution isn't 1 millisecond. It can vary anywhere between 5-50ms. Multiple sleeps would only multiply this resolution problem. LukeL's code works, is simpler to read and remember, and the timer resolution issue only applies once.
by tunginobi
Feb 18, 2007 5:16
Forum: General
Topic: shared library not working?
Replies: 7
Views: 2774

Like coderJeff said, this will do the trick: LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ./mytest As to why Linux doesn't search the current directory for libs, it's considered a security risk. Otherwise anybody could override vital system libraries with their own versions just by plonking in the malicious l...
by tunginobi
Feb 17, 2007 5:33
Forum: Archive
Topic: Bullet Rel
Replies: 4
Views: 3034

When playing Touhou, one thing I noticed was that some bullets would rotate as they moved. Instead of travelling in a straight line, they would have rotational velocity (maybe even rotational acceleration too.) Any plans for that?

Props for a cool idea. I've always loved scrolling shooters.
by tunginobi
Feb 16, 2007 10:50
Forum: General
Topic: OOP & Code Scope
Replies: 8
Views: 3630

Wouldnt it be better to have all the members of a Type or Class included in the scope of the declaration? Its seems like its a much cleaner and more logical implementation. Better than what? All members of a class are accessible inside the class and its members. Public members are also accessible o...
by tunginobi
Feb 15, 2007 0:50
Forum: Beginners
Topic: Creating a union of two types
Replies: 7
Views: 2476

That's awesome. Thanks!