Connecting Tech Pros Worldwide Forums | Help | Site Map

Incredibly simple graphics question

Jason Swett
Guest
 
Posts: n/a
#1: Jul 22 '05
I want to do graphics with C++. Surprisingly, so far nobody has been
able to tell me anything helpful. How do I do it? Any input would be
greatly appreciated.

Jason

Randy Yates
Guest
 
Posts: n/a
#2: Jul 22 '05

re: Incredibly simple graphics question


drew_is_my_friend@hotmail.com (Jason Swett) writes:
[color=blue]
> I want to do graphics with C++. Surprisingly, so far nobody has been
> able to tell me anything helpful. How do I do it? Any input would be
> greatly appreciated.[/color]

Probably because graphics operations are not provided natively in the
language. If you're on a win32 platform, I suggest you do one or more
of the following (two of which assume you're NOT a MS-dweeb with Visual
Studio):

1. Begin perusing the win32 api. There is a Windows help file with
the api defined at www.mingw.org that I find very helpful.

2. Buy Charles Petzold's book "Programming Windows" (whatever the
latest incarnation is).

3. Install mingw and become familiar with the environment.

--Randy


--
% Randy Yates % "She's sweet on Wagner-I think she'd die for Beethoven.
%% Fuquay-Varina, NC % She love the way Puccini lays down a tune, and
%%% 919-577-9882 % Verdi's always creepin' from her room."
%%%% <yates@ieee.org> % "Rockaria", *A New World Record*, ELO
http://home.earthlink.net/~yatescr
JKop
Guest
 
Posts: n/a
#3: Jul 22 '05

re: Incredibly simple graphics question


Jason Swett posted:
[color=blue]
> I want to do graphics with C++. Surprisingly, so far nobody has been
> able to tell me anything helpful. How do I do it? Any input would be
> greatly appreciated.
>
> Jason
>[/color]

Google for "OpenGL C++".


-JKop
Mike Wahler
Guest
 
Posts: n/a
#4: Jul 22 '05

re: Incredibly simple graphics question


"Jason Swett" <drew_is_my_friend@hotmail.com> wrote in message
news:a0c04b32.0410171311.47a681cc@posting.google.c om...
[color=blue]
> Re: Incredibly simple graphics question[/color]
[color=blue]
> I want to do graphics with C++.[/color]

Incredibly simple answer:

ISO standard C++ (the topic here) has absolutely no features
which support graphics.

Such a domain is inherently that of the host platform.
Since C++ is, by design, intended to be platform-neutral,
of course no such things are specified by the language.

Platform-specific libraries can be combined with the C++
language to achieve graphical applications on platforms
with graphics features (note that not all have them),
but such issues are not topical here. One such library
which can be built for a variety of platforms is:
www.wxwidgets.org
[color=blue]
>Surprisingly, so far nobody has been
> able to tell me anything helpful.[/color]

Because there's nothing to tell.
[color=blue]
>How do I do it?[/color]

You don't.
[color=blue]
>Any input would be
> greatly appreciated.[/color]

The following link is to an excerpt from the FAQ for newsgroup
'alt.comp.lang.learn.c-c++', but applies equally to 'comp.lang.c++' :

http://ma.rtij.nl/acllc-c++.FAQ.html#q4.6

Purpose of comp.lang.c++ :
http://www.slack.net/~shiva/welcome.txt

C++ FAQ:
http://www.parashift.com/c++-faq-lite/

You can locate newsgroups about particular topic(s) (e.g. an
operating system / platform) here:
www.groups.google.com

If you're concerned with Microsoft platform(s) (most folks asking
this question here seem to be), the authoritative source is:
www.msdn.microsoft.com
(which also has links to MS-related newsgroups)

-Mike


Phlip
Guest
 
Posts: n/a
#5: Jul 22 '05

re: Incredibly simple graphics question


Jason Swett wrote:
[color=blue]
> I want to do graphics with C++. Surprisingly, so far nobody has been
> able to tell me anything helpful. How do I do it? Any input would be
> greatly appreciated.[/color]

Have you tried www.google.com ?

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces


Michael
Guest
 
Posts: n/a
#6: Jul 22 '05

re: Incredibly simple graphics question



"JKop" <NULL@NULL.NULL> wrote in message
news:bmBcd.37289$Z14.13932@news.indigo.ie...[color=blue]
> Jason Swett posted:
>[color=green]
> > I want to do graphics with C++. Surprisingly, so far nobody has been
> > able to tell me anything helpful. How do I do it? Any input would be
> > greatly appreciated.
> >
> > Jason
> >[/color]
>
> Google for "OpenGL C++".
>
>
> -JKop[/color]

Google for "OpenGL C++ nehe"

Mike


Carl Muller
Guest
 
Posts: n/a
#7: Jul 22 '05

re: Incredibly simple graphics question


"Phlip" <phlip_cpp@yahoo.com> wrote in message news:<IIBcd.15328$3a5.7086@newssvr31.news.prodigy. com>...[color=blue]
> Jason Swett wrote:
>[color=green]
> > I want to do graphics with C++. Surprisingly, so far nobody has been
> > able to tell me anything helpful. How do I do it? Any input would be
> > greatly appreciated.[/color]
>
> Have you tried www.google.com ?[/color]
Yes, and he came up with
http://groups.google.com/groups?selm...&output=gplain

?STACK OVERFLOW.
Mabden
Guest
 
Posts: n/a
#8: Jul 22 '05

re: Incredibly simple graphics question


"Jason Swett" <drew_is_my_friend@hotmail.com> wrote in message
news:a0c04b32.0410171311.47a681cc@posting.google.c om...[color=blue]
> I want to do graphics with C++. Surprisingly, so far nobody has been
> able to tell me anything helpful. How do I do it? Any input would be
> greatly appreciated.[/color]

Look into C# if you are on a MS platform. There are free tools
available.
If you do, your future questions can be answered at
microsoft.public.dotnet.csharp.general and
microsoft.public.dotnet.languages.csharp

--
Mabden


Ioannis Vranos
Guest
 
Posts: n/a
#9: Jul 22 '05

re: Incredibly simple graphics question


Jason Swett wrote:
[color=blue]
> I want to do graphics with C++. Surprisingly, so far nobody has been
> able to tell me anything helpful. How do I do it? Any input would be
> greatly appreciated.[/color]


If you mean 3D graphics etc:

1) A multi platform graphics library is OpenGL.

2) A Windows library is DirectX, however in the upcoming Windows
version, DirectX will become a subset of the managed WinFX and probably
will change, so it would be better not invest much time on DirectX now.




If you mean GUI stuff, in Windows learn .NET. A good book to start is

"Visual C++ .NET How to Program" by Deitel.



--
Ioannis Vranos

http://www23.brinkster.com/noicys
Ioannis Vranos
Guest
 
Posts: n/a
#10: Jul 22 '05

re: Incredibly simple graphics question


Mabden wrote:
[color=blue]
> Look into C# if you are on a MS platform.[/color]


Don't troll.



--
Ioannis Vranos

http://www23.brinkster.com/noicys
Randy Yates
Guest
 
Posts: n/a
#11: Jul 22 '05

re: Incredibly simple graphics question


Ioannis Vranos <ivr@guesswh.at.grad.com> writes:
[color=blue]
> Mabden wrote:
>[color=green]
> > Look into C# if you are on a MS platform.[/color]
>
>
> Don't troll.[/color]

Can somebody please explain to me why we needed
a new language like C#?
--
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
randy.yates@sonyericsson.com, 919-472-1124
John Harrison
Guest
 
Posts: n/a
#12: Jul 22 '05

re: Incredibly simple graphics question



"Randy Yates" <randy.yates@sonyericsson.com> wrote in message
news:xxpzn29mq1b.fsf@usrts005.corpusers.net...[color=blue]
> Ioannis Vranos <ivr@guesswh.at.grad.com> writes:
>[color=green]
> > Mabden wrote:
> >[color=darkred]
> > > Look into C# if you are on a MS platform.[/color]
> >
> >
> > Don't troll.[/color]
>
> Can somebody please explain to me why we needed
> a new language like C#?[/color]

Because Microsoft wanted their own version of Java, after they fell out with
Sun.

john


Mabden
Guest
 
Posts: n/a
#13: Jul 22 '05

re: Incredibly simple graphics question


"John Harrison" <john_andronicus@hotmail.com> wrote in message
news:2u7atoF27114fU1@uni-berlin.de...[color=blue]
>
> "Randy Yates" <randy.yates@sonyericsson.com> wrote in message
> news:xxpzn29mq1b.fsf@usrts005.corpusers.net...[color=green][color=darkred]
> > > Mabden wrote:
> > >
> > > > Look into C# if you are on a MS platform.[/color]
> >
> > Can somebody please explain to me why we needed
> > a new language like C#?[/color]
>
> Because Microsoft wanted their own version of Java, after they fell[/color]
out with[color=blue]
> Sun.[/color]

There is that. C# is VB.Net is Cobol.Net is Perl.Net is ... Your program
is "compiled" to a byte-code version that run on a virtual machine.
Sound familiar? C# is just one of the many "faces" that you can use.
Basically, they can add a new language anytime, I think Python is
coming, or may be here already. The first ones were VB and C#. I know
with C# you can still create a standard EXE, as well.

They have made a lot of changes to how web pages work. They've extended
objects like buttons and fields to have server-side capability, and
added other features. They are taking some of the things you had to do
with JavaScript and putting them back on the server - IF YOU WANT. The
new technology also allows the developer to still use JavaScript, so
nothing is taken away.

I think the idea is to remove some of the cross-browser problems by
allowing the programmer to do things that would be problematic to
support on older browsers or other browser incompatibilities, in a known
and modern way. The growing availability of DSL type connections means
that the traffic back to the server isn't as important as it once was.

One of the scary things is that Microsoft may implement some
functionality by sending the browser JavaScript for you. In other words,
a black box determines the user's browser and send the appropriate code.
You "write once, run everywhere". Hmmmm, I've got deja vue.

--
Mabden


Ioannis Vranos
Guest
 
Posts: n/a
#14: Jul 22 '05

re: Incredibly simple graphics question


Mabden wrote:
[color=blue]
> There is that. C# is VB.Net is Cobol.Net is Perl.Net is ... Your program
> is "compiled" to a byte-code version that run on a virtual machine.
> Sound familiar? C# is just one of the many "faces" that you can use.
> Basically, they can add a new language anytime, I think Python is
> coming, or may be here already. The first ones were VB and C#. I know
> with C# you can still create a standard EXE, as well.[/color]


Or in other words, all languages have the same API. However C++ will
have more.

According to MS people, there will be more generics abilities available
to C++ than in other languages, and also C++ (with C++/CLI) is "correct
by default", while the other languages are "correct by explicit coding":
Deterministic destruction with objects in the stack, automatic compiler
creation of Dispose() including chaining calls to Dispose etc.

Consider also C++ templates, and what will be supported in the after
2005 version of VC++, objects of managed types in the unmanaged heap,
objects of unmanaged types in the managed heap, free mixing of managed
and unmanaged types, managed types inheriting from unmanaged types,
unmanaged types inheriting from managed types and various such
combinations, only available to C++.

Being vendor specific, VC++ 2005 will also provide OpenMP version 2
multithreading support (which you can download from
http://www.openmp.org) in addition to the standard .NET/CLI
multithreading, for hand tuning. Consider the code:


#include <vector>

int main()
{
using std::vector;


vector<int>someVec(100);


#pragma omp for
for(vector<int>::size_type i=0; i<someVec.size(); ++i)
someVec[i]=10*i;
}



C:\c>cl /clr temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.41013
for Microsoft (R) .NET Framework version 2.00.41013.0
Copyright (C) Microsoft Corporation. All rights reserved.

temp.cpp
Microsoft (R) Incremental Linker Version 8.00.41013
Copyright (C) Microsoft Corporation. All rights reserved.

/out:temp.exe
temp.obj

C:\c>



With this #pragma directive of the OpenMP 2 standard, the programmer
provides the guarantee that each assignment is independent of the other
assignments, and thus the compiler creates separate threads for each
assignment, taking advantage of the possible presence of multiple
processors in a system.


Consider this under the view of the upcoming multicore processors in the
mainstream, due to tend of 2005 - beginning of 2006.


Of course, according to the ISO C++ standard unknown #pragmas are
ignored, and thus the above code has no problem of portability to
compiles that do not support OpenMP:


C:\MinGW\bin\g++.exe -std=c++98 -pedantic-errors -Wall
-fexpensive-optimizations -O3 -ffloat-store -mcpu=pentiumpro temp.cpp -o
temp.exe

temp.cpp: In function `int main()':
temp.cpp:11: warning: ignoring #pragma omp for



Also VC++ 2005 will support Profile Guided Optimization.



The above will not be available to the other MS .NET languages.



According to MS, C++ becomes the systems programming language of .NET.



--
Ioannis Vranos

http://www23.brinkster.com/noicys
Closed Thread