Welcome, Guest. Please login or register.

Author Topic: C(++), OpenGL and coding demos  (Read 11519 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline z5Topic starter

  • Sr. Member
  • ****
  • Join Date: May 2002
  • Posts: 366
    • Show only replies by z5
    • http://ada.untergrund.net
C(++), OpenGL and coding demos
« on: January 21, 2003, 04:49:26 PM »
i've started learning C at evening classes on PC.

So i have a couple of questions:
- how different is C on pc and C on Amiga?
- What about c++ on Amiga?

Suppose that i start learning OpenGL on pc, would that allow me to program for Mesa on OS4?

What about demos? Could i code a demo in C on Amiga (OS4)? I know that not a lot of demos are coded in C. I think that Kierownik did a couple of demos/intros in C (electricity of Appendix, Metatag for Madwizards,...) and also Venusarts did some C demos.

Assembler seems to be the preffered language to code demos but will the advantages of assembler be as big on AOne / OS4 as on the classic Amiga. With different gfx-cards, soundcards, ... will there not be a shift more towards high level languages like C?

So basically, what i'm asking: if i learn C and OpenGL on pc (which would maybe come in handy if i want to search a job in programming), would i be able to make the step to AOne/OS4 relatively easily (assuming that OS4 will apear). Wouldn't that be a better option than to start assembler for 68k?
A.miga D.emoscene A.rchive: Relive the dreams...
 

Offline yssing

  • Hero Member
  • *****
  • Join Date: Apr 2002
  • Posts: 1517
    • Show only replies by yssing
    • http://www.yssing.org
Re: C(++), OpenGL and coding demos
« Reply #1 on: January 21, 2003, 05:05:49 PM »
To me, starting off with OpenGL might be a bit to much.
But since OpenGL is a standard on several systems, your code (made on the PC) should rather easy to port.
But befor you start doing that, might I suggest starting off with some amiga specific programming.
Anyway, talkin about C (ANSI), then there are no big difference, I have been programming PCs amigas and Microsystems for some time now, most in ANSI.
And the code is rather portable, ofcourse, there are some system specific functions. that you need to replace.

Coding Demos using C should not be a problem, and as for speed. C compilers are very good, and on an A1 I don't think speed should be your biggest concern.

 

Offline Sidewinder

  • Full Member
  • ***
  • Join Date: Mar 2002
  • Posts: 241
    • Show only replies by Sidewinder
    • http://www.liquido2.com
Re: C(++), OpenGL and coding demos
« Reply #2 on: January 21, 2003, 05:09:05 PM »
Many of the concepts learned on the PC can be transfered to the Amiga.  If you are going to code demos for OS4 you can certainly use C.  The PPC processor has plenty of power and learning assembly for it (although interesting and possibly helpful) is not needed.

OpenGL is essentially the same on all platforms.  I've used OpenGL on the PC and on the Amiga and the only difference is in the OS specific stuff like window setup, event processing, etc.  The actual OpenGL code is portable.

So if you want to learn to code on the PC the knowledge will apply to the Amiga also.
Sidewinder
 

  • Guest
Re: C(++), OpenGL and coding demos
« Reply #3 on: January 21, 2003, 05:20:35 PM »
Writing console programs on pc and amiga should be nearly the same. You'll have to find documentation specific to the amiga gui, kinda like windows has microsoft foundation classes(MFC) to make dialog boxes etc. i did a google on 'amiga' and 'c++' and theres a few out there, high-soft seems to make one. for taking advantage of your gfx card openGL would be the way to go, since Direct3d isnt an option  ;-). ASM is good to learn to see how the processor works... learning PPC ASM would be very interesting.. but for coding applications dont bother with it.. i'd check aminet and the web for some scene demos where the source was included too. oh and for programming one of the best line of books is  www.wrox.com  ... dont bother with any books that has -visual- in it tho , cus they mean visual c++ for windows etc. learning a language seems daunting at first, it will seem like your going nowhere with it, but soon everything falls into place. good luck!
 

Offline z5Topic starter

  • Sr. Member
  • ****
  • Join Date: May 2002
  • Posts: 366
    • Show only replies by z5
    • http://ada.untergrund.net
Re: C(++), OpenGL and coding demos
« Reply #4 on: January 21, 2003, 06:00:32 PM »
thanks for the replies.

Well, i'm not exaclty a newbee in programming (i learned the usual stuff like pascal, a bit of C, i have a basic grasp of Visual Basic). So i'm not really worried about learning it.

I just want to find the best combination to learn. Something that i could learn on pc (and maybe even get a job). But something that i could use to code demos (my big dream) on Amiga. I have the impression that demos on the pc are coded mostly in C++ and OpenGL or directX.

Assembler seems cool but somehow i feel taht it will take too much time and that this time would be better spend on a more widely used language (also usable on pc).

So c++ and OpenGL seem a good option.

Any good books/websites on this? (OpenGL and C++).

Seems that the NEHE tutorials are really good to start with for OpenGL .Nehe tutorials
A.miga D.emoscene A.rchive: Relive the dreams...
 

Offline FluffyMcDeath

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 3440
    • Show only replies by FluffyMcDeath
Re: C(++), OpenGL and coding demos
« Reply #5 on: January 21, 2003, 07:06:13 PM »
Single threaded standard c library stuff should port between the two no problem.

OpenGL to Mesa should be fairly trivial.

For demo coding (since the point is to squeeze as much out of the machine as you can and to proove what a smarty pants you are) there is always room for a little assembly, but most everything can be written in C (and probably should be for a first attempt, then optimise the critical bits).

Once you are programming the GUI or you are writing programs with multiple threads, and message passing and etc. you are getting intimate with the operating system and then the APIs are quite different. Many of the concepts are shared, but the spelling is quite different.
 

Offline Dagon

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 612
    • Show only replies by Dagon
    • http://www.amigasympan.gr/depa
Re: C(++), OpenGL and coding demos
« Reply #6 on: January 21, 2003, 09:10:37 PM »
ZiNE said:
Quote

oh and for programming one of the best line of books is www.wrox.com ... dont bother with any books that has -visual- in it tho , cus they mean visual c++ for windows etc.

yeah my first C++ book was Beginning C++ the complete language ANSI/ISO by Ivor Horton (wrox) :)

Another good book they say it is that of Stroustrup (the one who made C++) but I also heard it is a little bit difficult.
\\"So we must exercise ourselves in the things which bring happiness, since, if that be present, we have everything, and, if that be absent, all our actions are directed towards attaining it\\" - Epicurus
 

Offline iamaboringperson

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 5744
    • Show only replies by iamaboringperson
Re: C(++), OpenGL and coding demos
« Reply #7 on: January 21, 2003, 09:53:51 PM »
wow! your going a bit fast!!
dont try to learn too much of a language at a time!
you will probably notice that in the course your doing they will teach you in small steps, thats the best way!

if your C code is plain ANSI,( or even K&R), the exact same code should work on all computers with an ANSI C compiler!
get a C compiler for you amiga, and use it to practice on!
take home examples from the course, and use them for practice at home on your amiga!

the only problem is, they may use some includes such as "console.h" - just take that out & dont use any of the functions defined inside, they wont work on the amiga

AmigaOS never had very good support for C++, the standard way to code on amiga is C, not C++, you can still use C++, but by default you will have to call the os functions using C, unless you find some third party C++ libraries

dont worry about demos etc... for now, concentrate on the _language_ first, then learn some of the basics for intuition programming, just to get a feel for amiga programming, writing graphics software for the amiga, is a hell of a lot more advanced than just plain vanilla C, which, can be hard enough to learn on its own!

 :-)
 

Offline Glaucus

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4518
    • Show only replies by Glaucus
    • http://members.shaw.ca/mveroukis/
Re: C(++), OpenGL and coding demos
« Reply #8 on: January 21, 2003, 10:03:49 PM »
Quote
Another good book they say it is that of Stroustrup (the one who made C++) but I also heard it is a little bit difficult.


Yes, I have this book and it's rather dry.  It makes for a great reference book though.  I would recommend some other book just to get you started.

  - Mike
YOU ARE NOT IMMUNE
 

Offline iamaboringperson

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 5744
    • Show only replies by iamaboringperson
Re: C(++), OpenGL and coding demos
« Reply #9 on: January 21, 2003, 10:22:58 PM »
i have stroustrup's book, the hard cover special edition!
i think its quite good!
probably not for beginners though

a good book on C that i reccomend is
C the complete reference (fourth edition)
by Herbert Schildt
this is an excelent book, and i can hardly recomend it enough
straight after i bought it, i read it like a novel, from cover to cover! good stuff indeed!

 

Offline Cymric

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 1031
    • Show only replies by Cymric
Re: C(++), OpenGL and coding demos
« Reply #10 on: January 21, 2003, 10:25:04 PM »
Quote
z5 wrote:
Learned languages: Pascal, C, Visual Basic. Demos seem to use C++ plus OpenGL/DirectX. C++, here I come.

Enjoy! But one word of warning here. Your previous experience with programming languages falls into the category of old procedural ones---although I'm not sure what the Beast has done to poor BASIC by Visual-ising it. C++ is object oriented ('OO'), and requires an entirely different approach to programming. 99% of all the books you'll find on C++ do not teach you how to do this: they only focus on the syntax of the language, perhaps mentioning the characteristics of OO in passing. This has you quickly falling into the trap of using C++ as a 'better C'. Your programs will still work, of course, but will not unleash the full potential of C++.

I can therefore recommend you try and find a book on OO design or OO development after you've read a book on C++, and decided you like the language enough to stick with it for a while. I myself use Cay Horstmann's Practical Object-Oriented Development in C++ and Java (Wiley, New York, 1997, ISBN 0-471-14767-2), which is a readable and rich source of do's and don'ts in both C++ and Java. It is a bit dated, but the techniques it describes are still very valid, and you can always try and find something more modern. Have fun!
Some people say that cats are sneaky, evil and cruel. True, and they have many other fine qualities as well.
 

  • Guest
Re: C(++), OpenGL and coding demos
« Reply #11 on: January 21, 2003, 11:37:19 PM »
If you want to do demos using OpenGL/Warp3D I see no reason to use assembly, as the 3D hardware / API is doing all the low level rendering stuff (and transformations) you would normally do in assembly.

For 68k demos (and to some extend software rendered ppc demos, but who want software rendering there?) assembly is more or less necessary, but there's no need to do everything in assembly (unless you want to spend lots of time coding ofcourse ;).  
We (Loonies) do (almost) all our demos in mostly c++, and only have the most time critical parts in assembly. That's usually more or less limited to the rendering innerloops, so for simple 2D stuff this can be most of the routine (excluding simple setup and design stuff), while for more advanced 3d stuff the assembly is maybe counting for something like 5-10% .

 


 

Offline z5Topic starter

  • Sr. Member
  • ****
  • Join Date: May 2002
  • Posts: 366
    • Show only replies by z5
    • http://ada.untergrund.net
Re: C(++), OpenGL and coding demos
« Reply #12 on: January 22, 2003, 11:47:03 AM »
@psycho:

Interesting.  Are you saying that intros like The Castle (which seems so optimised for Amiga) contains C-code also?

Also, what software do you use, generally speaking, to develop an Amiga demo from start to finish. (compilers, paint, sound). Any names of tools, software? Do you write your code on pc first? And how difficult would it be to port a demo you wrote on Amiga to pc or from pc to Amiga.

What is Warp3D? And what is the link with OpenGL.
A.miga D.emoscene A.rchive: Relive the dreams...
 

Offline yssing

  • Hero Member
  • *****
  • Join Date: Apr 2002
  • Posts: 1517
    • Show only replies by yssing
    • http://www.yssing.org
Re: C(++), OpenGL and coding demos
« Reply #13 on: January 22, 2003, 12:43:24 PM »
Warp3D is the amiga native 3D library implementation. It uses HW to render, tho there is a SW rendere (PPC only)
It uses AFAIK some of the same functions as GLUT (correct me if I am wrong)

 

Offline Mr_Capehill

  • Full Member
  • ***
  • Join Date: May 2002
  • Posts: 189
    • Show only replies by Mr_Capehill
Re: C(++), OpenGL and coding demos
« Reply #14 on: January 22, 2003, 03:01:35 PM »
Is the StormMesa material somewhere to download? H&P seemed to remove the links...

AFAIK, StormMesa uses Warp3D for HW acceleration.

I am also starting to learn OpenGL...Now if H-J and T would drop a line or two here
 ;-)