473,387 Members | 3,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Incredibly simple graphics question

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
Jul 22 '05 #1
13 2229
dr***************@hotmail.com (Jason Swett) writes:
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.


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."
%%%% <ya***@ieee.org> % "Rockaria", *A New World Record*, ELO
http://home.earthlink.net/~yatescr
Jul 22 '05 #2
Jason Swett posted:
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


Google for "OpenGL C++".
-JKop
Jul 22 '05 #3
"Jason Swett" <dr***************@hotmail.com> wrote in message
news:a0**************************@posting.google.c om...
Re: Incredibly simple graphics question I want to do graphics with C++.
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
Surprisingly, so far nobody has been
able to tell me anything helpful.
Because there's nothing to tell.
How do I do it?
You don't.
Any input would be
greatly appreciated.


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
Jul 22 '05 #4
Jason Swett wrote:
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.


Have you tried www.google.com ?

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 22 '05 #5

"JKop" <NU**@NULL.NULL> wrote in message
news:bm*******************@news.indigo.ie...
Jason Swett posted:
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


Google for "OpenGL C++".
-JKop


Google for "OpenGL C++ nehe"

Mike
Jul 22 '05 #6
"Phlip" <ph*******@yahoo.com> wrote in message news:<II******************@newssvr31.news.prodigy. com>...
Jason Swett wrote:
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.


Have you tried www.google.com ?

Yes, and he came up with
http://groups.google.com/groups?selm...&output=gplain

?STACK OVERFLOW.
Jul 22 '05 #7
"Jason Swett" <dr***************@hotmail.com> wrote in message
news:a0**************************@posting.google.c om...
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.


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
Jul 22 '05 #8
Jason Swett wrote:
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.

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
Jul 22 '05 #9
Mabden wrote:
Look into C# if you are on a MS platform.

Don't troll.

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 22 '05 #10
Ioannis Vranos <iv*@guesswh.at.grad.com> writes:
Mabden wrote:
Look into C# if you are on a MS platform.

Don't troll.


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
ra*********@sonyericsson.com, 919-472-1124
Jul 22 '05 #11

"Randy Yates" <ra*********@sonyericsson.com> wrote in message
news:xx*************@usrts005.corpusers.net...
Ioannis Vranos <iv*@guesswh.at.grad.com> writes:
Mabden wrote:
Look into C# if you are on a MS platform.

Don't troll.


Can somebody please explain to me why we needed
a new language like C#?


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

john
Jul 22 '05 #12
"John Harrison" <jo*************@hotmail.com> wrote in message
news:2u*************@uni-berlin.de...

"Randy Yates" <ra*********@sonyericsson.com> wrote in message
news:xx*************@usrts005.corpusers.net...
Mabden wrote:

> Look into C# if you are on a MS platform.
Can somebody please explain to me why we needed
a new language like C#?


Because Microsoft wanted their own version of Java, after they fell

out with Sun.


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
Jul 22 '05 #13
Mabden wrote:
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.

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
Jul 22 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Support | last post by:
Hello: Using asp.net (vb) and I dont want to use active X controls - just server side code. I have uploaded a gif file but I want to resample it to a smaller size like 100 by 100 and save it to a...
5
by: fripper | last post by:
I have a VB 2005 app ... main window has a picture box control (picControl) .... I want to draw a rectangle in that control using GDI+ ... something like: Dim g as graphics = creategraphics|()...
4
by: pcnerd | last post by:
I originally asked this question in the "classic" VB forum. It occured to me after I had sent it that I sent it to the wrong forum. Anyway! Here's the situation. I have VB.NET 2005 Express...
5
by: Tim | last post by:
hi I used to do this Dim gfx As System.Drawing.Graphics = pic1.CreateGraphics gfx.FillEllipse blah blah blah to draw straight onto a form. but this is frowned up (slow).
6
by: Chris Dunaway | last post by:
The method for printing documents in .Net can be confusing, especially for newer users. I would like to create a way to simplify this process. My idea would be implemented using a PrintDocument...
15
by: Hamed | last post by:
Have I posted the message to wrong newsgroup? Or Does the question is so much strage? Would someone please kindly direct me to a true newsgroup or resource? Best Regards Hamed
4
by: Carsten Schmitt | last post by:
Hello, I want to draw a simple pixel (i.e. a red pixel in the center of the screen), which is always in the foreground - even when running a fullscreen application like a DirectX game. I need...
1
by: James Willmott | last post by:
If I have a question, about how to implement a graphics algorithm in C++, but not specifically related to getting the graphics on screen (that I can work out for myself). Would asking for help in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.