POV-Ray : Newsgroups : povray.off-topic : Learning C++ Server Time
7 Sep 2024 01:23:09 EDT (-0400)
  Learning C++ (Message 41 to 50 of 57)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 7 Messages >>>
From: Kevin Wampler
Subject: Re: Learning C++
Date: 12 Dec 2008 14:15:26
Message: <4942b84e$1@news.povray.org>
Eero Ahonen wrote:
> Mike Raiford wrote:
>> Eero Ahonen wrote:
>>> I once made a Pong -clone with Pascal. It was very hard to beat the
>>> computer, since I saved memory and used the same variable for the Y-axis
>>> placement for computer player and the ball :).
>> Nice!
>>
> 
> Nobody even noticed anything. Couple of guys tested it and played for
> something like hour oslt and just told me that it's freaking hard :D.

That's awesome.


Post a reply to this message

From: Orchid XP v8
Subject: Re: Learning C++
Date: 12 Dec 2008 15:27:14
Message: <4942c922$1@news.povray.org>
> I've written a few graphics apps in Java. I eventually wrote a (very 
> simple) image-screen class which I could plot to pixel by pixel, then 
> dump to the window when I wanted an update. Much easier than piddling 
> around with the AWT!
> 
> But you're right, I still had to plumb that into some window container 
> or whatever it was.

Yeah, this is what I ended up doing too. For Java, and more recently for 
GTK. (GTK has strong support for vector graphics, but still no help if 
you want to do bitmapped stuff algorithmically.) I've yet to find a good 
way to handle displaying stuff on the screen so it responds to damage 
messages yet your main program still continues executing...

>>>> (Back when I was a kid, you could just say "plot 4, 7" and it would 
>>>> draw a dot there. Ah, I had no idea how good I had it!)
> 
> Those were indeed the days. Interpreted BASIC, where you could type that 
> directly into the command prompt and see the dot appear on the other 
> side of the screen.... *sighs*

Even [gasp] POV-Ray isn't *that* easy...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: clipka
Subject: Re: Learning C++
Date: 12 Dec 2008 19:15:01
Message: <web.4942fe58267f2ab07c822d860@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> Warp wrote:
> ...and this is the reason why. Almost *no* languages have the capability
> to easily draw graphics these days.
>
> (Back when I was a kid, you could just say "plot 4, 7" and it would draw
> a dot there. Ah, I had no idea how good I had it!)

How about C# in a .NET environment? Just have the wizard create a program
template for you, code your custon OnDraw() handler, and hey presto! There you
go.

Okay, it's not "plot 4, 7" but "gr.draw(...);", so a few characters more, but
nothing conceptually challenging. Except that there's no "plot", so you have to
draw small circles or boxes to produce a dot.


But I remember, back in the days when I was learning C, I had similar problems -
all the more since I didn't have the slightest clue about programming for
Windows GUI nor X-Window (I could have gotten access to both at the institute).
But I desperately wanted to code a Quake level mapper, and *needed* some good
graphics output.

Fortunately I happened to know a bit of PostScript coding then, so I ended up
using the laser printers for graphics output :) (Later I also used GhostScript
in order to not waste too much paper, but of course it never came close to the
quality of the A3 laser prints...)


> > And you should forget
> > trying to program with the Windows API directly, unless you have *tons* of
> > experience with it, or you want to die prematurely.
>
> This made me actually laugh out loud. For real. Such a glowing
> recommendation of the Win32 API! :-D

Seen it once. I guess it's not *too* difficult for an *experienced* programmer
to get into it, but fortunately there's no need to: Virtually all mainstream
programming languages come with a framework that is *way* easier to use.

The main problem with the Windows API is that it's C, and doesn't actually lend
itself to being driven by C++ programs, plus there's a lot of "bureaucratic"
overhead involved, which begs to be handled by a framework instead of the
application developer.

> (OTOH, I understand that the raw X Windows bindings are even harder...
> apparently... I guess that's why there's so many toolkits!)

I've never seen the X APIs, but I imagine they're probably the same level of
complexity as the Microsoft APIs.


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Learning C++
Date: 12 Dec 2008 19:58:24
Message: <494308b0@news.povray.org>
clipka wrote:
> I've never seen the X APIs, but I imagine they're probably the same level
> of complexity as the Microsoft APIs.

No they aren't. X doesn't provide any UI widgets as far as I know.

Most X example apps use only black and white, which makes me think using
more than two colors is an extra pain. That is because they the only colors
X guarantees that exist.


Post a reply to this message

From: Mueen Nawaz
Subject: Re: Learning C++
Date: 12 Dec 2008 20:08:54
Message: <49430b26$1@news.povray.org>
Darren New wrote:
> Thanks. Already downloaded it, haven't waded thru it very far. :-) I've
> been finding motivation a bit hard to come by lately.

	It may be a good book, but its examples are not exactly motivational
material.

-- 
Beware of quantum ducks.       Quark!     Quark!


                    /\  /\               /\  /
                   /  \/  \ u e e n     /  \/  a w a z
                       >>>>>>mue### [at] nawazorg<<<<<<
                                   anl


Post a reply to this message

From: Mueen Nawaz
Subject: Re: Learning C++
Date: 12 Dec 2008 20:15:49
Message: <49430cc5@news.povray.org>
Invisible wrote:
> ...and this is the reason why. Almost *no* languages have the capability
> to easily draw graphics these days.
> 
> (Back when I was a kid, you could just say "plot 4, 7" and it would draw
> a dot there. Ah, I had no idea how good I had it!)

	I've heard good things about Pygame.

-- 
Beware of quantum ducks.       Quark!     Quark!


                    /\  /\               /\  /
                   /  \/  \ u e e n     /  \/  a w a z
                       >>>>>>mue### [at] nawazorg<<<<<<
                                   anl


Post a reply to this message

From: Darren New
Subject: Re: Learning C++
Date: 12 Dec 2008 20:25:16
Message: <49430efc$1@news.povray.org>
Nicolas Alvarez wrote:
> Most X example apps use only black and white, which makes me think using
> more than two colors is an extra pain. That is because they the only colors
> X guarantees that exist.

Last I looked, you not only have to know how many colors the screen 
supports, but you have to order the bytes and such in the same order as they 
are in the hardware. I.e., you query the X server for how many bits and in 
what order the colors are, then you have to give all colors in that form to 
the server. You have to convert the images yourself, put them in the right 
order with the right stride, etc.

Now, note that "last I looked", an 8-bit color card for a machine that could 
run UNIX was a thousand dollars or so, some 15 years ago, so take it with a 
grain or two.

-- 
   Darren New, San Diego CA, USA (PST)
   The NFL should go international. I'd pay to
   see the Detroit Lions vs the Roman Catholics.


Post a reply to this message

From: Warp
Subject: Re: Learning C++
Date: 13 Dec 2008 10:30:56
Message: <4943d52f@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Or do people just 
> interface to C libraries for that sort of thing?

  I think most libraries out there are written in C rather than C++.
I suppose the ideology is something like "if I write it in C, it will
be still usable in C++, but I will get a much larger group of users
this way".

  Sometimes someone will then write a C++ wrapper to make it easier to
use the library. The quality of such C++ wrappers vary wildly. (In my
little experience the average tends to be on the worse side, unfortunately.)

-- 
                                                          - Warp


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Learning C++
Date: 13 Dec 2008 10:55:40
Message: <4943dafc@news.povray.org>
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> Or do people just
>> interface to C libraries for that sort of thing?
> 
>   I think most libraries out there are written in C rather than C++.
> I suppose the ideology is something like "if I write it in C, it will
> be still usable in C++, but I will get a much larger group of users
> this way".
> 
>   Sometimes someone will then write a C++ wrapper to make it easier to
> use the library. The quality of such C++ wrappers vary wildly. (In my
> little experience the average tends to be on the worse side,
> unfortunately.)

A good approach (that few people use) is making the library in C++ and
making a C wrapper :)


Post a reply to this message

From: nemesis
Subject: Re: Learning C++
Date: 13 Dec 2008 11:06:56
Message: <4943dda0$1@news.povray.org>
Nicolas Alvarez wrote:
> No they aren't. X doesn't provide any UI widgets as far as I know.

Hmm...

nemesis@nemesis-desktop:~$ ls -lh /usr/lib/libXaw7.so.7.0.0
-rw-r--r-- 1 root root 358K 2007-07-24 07:00 /usr/lib/libXaw7.so.7.0.0

Looks still in place...


http://en.wikipedia.org/wiki/Xaw


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 7 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.