Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 09 Jan 2001
Offline Last Active Sep 28 2016 01:40 PM

#5258187 Why didn't somebody tell me?

Posted by on 20 October 2015 - 03:41 PM

Lessie if I can explain better: (or maybe just make it more confusing)

const int* type1; // non-const pointer to const int
int* const type2; // const pointer to non-const int

int value1 = 1 * 2; // 2
int value2 = 2 * 1; // also 2

typedef int* IntPtr;
const IntPtr type3; // const pointer to non-const int
IntPtr const type4; // ALSO const pointer to non-const int

const int onePlusOne = 1 + 1;
int value3 = onePlusOne * 2; // 4
int value4 = 2 * onePlusOne; // 4

#define INT_PTR int*
const INT_PTR type5; // non-const pointer to const int!
INT_PTR const type6; // const pointer to non-const int

// of course if the * isn't there, suddenly const is commutative
const int type7; // const int
int const type8; // ALSO a const int

I'm still lost. Maybe I'm reading your example as compilable code and it's not? type1 - 8 are not used with value1 - 4, so I'm lost on the math issue. How does const int vs. int const change the way the compiler calculates the mathematical expressions?

#5258011 Problems writing a BMP exporter

Posted by on 19 October 2015 - 05:12 PM

Its kind of funny how those two modes work, they have basically an entire complete PNG or JPEG file where the pixel data should be. (you can read in a JPEG file, stick it inside of a bitmap container in memory, and send it to GDI and it will render it)

Most likely to get around patent issues.

#5258009 Why didn't somebody tell me?

Posted by on 19 October 2015 - 04:59 PM

int i = 1 + 1 * 2; // 3
// here's the "typedef"
const int onePlusOne = 1 + 1;
int j = onePlusOne * 2; // 4, not 3

I fail to see the problem with that. blink.png

#5257714 How to create shader that fades based on two different connecting surface angles

Posted by on 17 October 2015 - 03:34 PM

It looks like ambient occlusion.

#5256580 Should I use OpenGL or Directx

Posted by on 10 October 2015 - 03:30 PM

This question has been asked multiple times and is actually not allowed.

From the For Beginners FAQ:

"This" versus "that" threads are considered flame bait and will usually be closed on sight. Such questions have usually been asked before, several times, so there should be no need to ask them again.

#5256556 The wrong way to count lines of code

Posted by on 10 October 2015 - 12:39 PM

Not really. It's a useful metric- at least it would be if they implemented it properly. Gives you a ball park figure of how complex a project is.

It really isn't. Brackets, for instance, are arbitrary. They make the code cleaner, but do not translate to machine code. There is quite a bit in all modern languages that exists for aesthetics and code organization that do not have any effect on the final machine code.


is equal to this:

Your code really isn't any more compact in the first case.

#5255919 What's the best system on which to learn ASM?

Posted by on 06 October 2015 - 06:15 PM

I vote 68000. I learned to program on a Mac 512KE and the only processor I've actually learned assembly for was the 68000. It has a remarkably easy and rather nice instruction set.

#5255130 which program I should use for a text adventure

Posted by on 02 October 2015 - 07:34 AM

Hi Snatcher,
Have you considered using a programming language instead? It would give you the ability to build on your efforts from creating this in the future.
I'm currently learning javascript and am working on a text adventure also with some graphics.
Good luck either way and let us know how you get on.

I've been wanting to make a text adventure game for years. I've been programming for 30 years. Text adventures are easy to write, so long as you don't include a command parser. This is absurdly hard to get right. I've tried and failed. Parsing the individual commands is easy. Applying the parsed commands to grammar rules is not so. If you can find a program that does this for you, use it!

#5255068 which program I should use for a text adventure

Posted by on 01 October 2015 - 07:24 PM

I'd use Quest, if for no other reason than the website actually shows how to use it. Twine seems like an afterthought.

#5255059 Need scene graph advice, please!

Posted by on 01 October 2015 - 04:50 PM

Tom Forsyth gives a pretty good argument against scene graphs in his blog. It falls under his OffendOMatic blog post!

#5255023 Books with decent, real and useful projects?

Posted by on 01 October 2015 - 01:00 PM

Someone else will have to chime in then. I gave up on programming related books years ago. There may be books like what you're looking for, but I haven't checked in nearly a decade.

#5254931 Books with decent, real and useful projects?

Posted by on 01 October 2015 - 12:25 AM

This was a common theme back in the 90's when graphics APIs either didn't exist or were in their infancy. I have several very old computer graphics books that detail how to make something useful, from start to finish, and all use software renderers. I think the focus has shifted now to explaining how to use the various features of the different APIs, and since the APIs are so complex, the authors really do not have the time or space for much else. It is left to the reader to assemble the pieces into something useful.

That being said, I no longer recommend buying books on any computer graphics related subjects. The technology changes so fast these days that by the time the book makes it to print, it is seriously outdated. You'll find more up to date stuff online where changes can be published immediately.

#5254476 Glut & opengl only for 2D [Question]

Posted by on 28 September 2015 - 02:37 PM

Yes, OpenGL is well suited to 2D rendering. Google "OpenGL orthographic projection" to get started. You could also use DirectX, if you wanted. 2D is 3D, missing a D. *wink*

#5254080 Creating a filled Bresenham's ellipse

Posted by on 25 September 2015 - 09:49 PM

I just found this: http://enchantia.com/graphapp/doc/tech/ellipses.html

It looks interesting as well.

#5253862 sprite render is very slow

Posted by on 24 September 2015 - 01:36 PM

I'm sorry, but you're going to have to provide more than a compressed archive of code if you want to get help. Post the sprite rendering code here in code tags. I'm not going to download a compressed archive and dig through multiple files to try and figure out where the error is and I doubt many people would either.

Also, it sounds like you want someone to download your code base, fix it and then send it back to you. Not going to happen. We'll comment on the code you post openly on the forum, but you'll need to be the one to make the changes.