Forum Archive

Go Back   3D Realms Forums > General Topics > Programming Forum
Blogs FAQ Members List Social Groups Calendar Mark Forums Read

Notices

 
 
Thread Tools
Old 02-09-2007, 02:12 AM   #1
Phait

Phait's Avatar
Questions about C/C++
Having gotten back into my PHP coding groove, I'm thinking of getting into C/C++ to code some small apps. Maybe a few personal apps to make productivity easier or a neat little utility, I dunno.

I know there's Visual C++, but I believe that costs money, and I know there's gotta be some freebies out there - although my guess is if you want Visual C you have to pay, but normal hand-coding/compiling can be done without paying a dime. Basically since it's something I just wanna dabble in, I don't wanna make any monetary commitments yet.

But I don't know. Anyway, my main question is, if I'm not using a visual environment, how are (Windows) GUIs created and used?
__________________
Music: http://www.oquilluksound.com Album: http://machinefaultred.blogspot.com Album Calendar Youtube: http://www.youtube.com/oquilluksound

"but I promise you this, I'll always look out for you, that's what I do" -Coldplay
Phait is offline  
Old 02-09-2007, 04:41 AM   #2
Samji

Samji's Avatar
Re: Questions about C/C++
I was messing around with C++ yesterday. Good IDEs are Code::Blocks and Dev-C++.

I personally found using PS Pad with MinGW set up as the compiler (G++) was pretty good for quick creation of small apps.
__________________
Sam's Py
Samji is offline  
Old 02-09-2007, 05:18 AM   #3
Foxy
Re: Questions about C/C++
Quote:
But I don't know. Anyway, my main question is, if I'm not using a visual environment, how are (Windows) GUIs created and used?
You use a toolkit like wxwidgets. It usually goes along the lines of initialising a 'window' object with some code, and then manipulating it. This should make it clearer:

http://www.wxwidgets.org/docs/technote/dlgbased.htm
Foxy is offline  
Old 02-09-2007, 05:30 AM   #4
Phait

Phait's Avatar
Re: Questions about C/C++
Thanks.

Also it seems there is a Visual C++ Express edition that is completely free:
http://msdn.microsoft.com/vstudio/ex...ualc/features/

Comparisons:
http://msdn2.microsoft.com/en-us/vstudio/aa700921.aspx
__________________
Music: http://www.oquilluksound.com Album: http://machinefaultred.blogspot.com Album Calendar Youtube: http://www.youtube.com/oquilluksound

"but I promise you this, I'll always look out for you, that's what I do" -Coldplay
Phait is offline  
Old 02-09-2007, 05:39 AM   #5
Foxy
Re: Questions about C/C++
IMO it'd be silly to lock yourself into MS VC++ (that's clearly their intention with the freebie), but that's just me.
Foxy is offline  
Old 02-09-2007, 05:50 AM   #6
Phait

Phait's Avatar
Re: Questions about C/C++
Ok, but explain why? Remember the intention here, for little and simple apps/utilities.
__________________
Music: http://www.oquilluksound.com Album: http://machinefaultred.blogspot.com Album Calendar Youtube: http://www.youtube.com/oquilluksound

"but I promise you this, I'll always look out for you, that's what I do" -Coldplay
Phait is offline  
Old 02-09-2007, 06:36 AM   #7
Foxy
Re: Questions about C/C++
If you learn with VC++, you're stuck in the mold of using VC++.

Plus, in my experience, VC++ tries to do everything for you visually. Which led me to learn **** all when I was using it. Better to stick to pure code. It's like handwriting HTML/CSS instead of using Frontpage - you know what is going on, and can appreciate everything a lot more. Plus you end up with better code.
Foxy is offline  
Old 02-11-2007, 09:47 PM   #8
Delta

Delta's Avatar
Re: Questions about C/C++
All VC++ does is provide you with a list of possible keywords or objects as you're typing the code (IntelliSense). It's made more for convenience, so you don't have to type so much. Not having that means you have to remember the names of all of the methods in a class or somesuch, and/or switch between some API reference and your code.

Also, HTML/Frontpage is a bad analogy IMO, because in VC++, you're still typing code. It's not a visual designer type thing (unless you're using .NET WinForms or something).
Delta is offline  
Old 02-12-2007, 04:58 AM   #9
Phait

Phait's Avatar
Re: Questions about C/C++
I think my first venture I'd like to do is a Sokoban clone:
http://www.goplay247.com/game/3172/Sokoban.html

I've always liked the game, it's simple but can be challenging (need to move crates to specific locations, have to think ahead).
__________________
Music: http://www.oquilluksound.com Album: http://machinefaultred.blogspot.com Album Calendar Youtube: http://www.youtube.com/oquilluksound

"but I promise you this, I'll always look out for you, that's what I do" -Coldplay
Phait is offline  
Old 02-12-2007, 06:31 AM   #10
Foxy
Re: Questions about C/C++
Quote:
All VC++ does is provide you with a list of possible keywords or objects as you're typing the code (IntelliSense). It's made more for convenience, so you don't have to type so much. Not having that means you have to remember the names of all of the methods in a class or somesuch, and/or switch between some API reference and your code.

Also, HTML/Frontpage is a bad analogy IMO, because in VC++, you're still typing code. It's not a visual designer type thing (unless you're using .NET WinForms or something).
Hm, when I used it it was all dialogs and auto-generated code with little '//TODO's inserted in various places.
Foxy is offline  
Old 02-14-2007, 06:39 AM   #11
Phait

Phait's Avatar
Re: Questions about C/C++
I just remembered SDL
http://en.wikipedia.org/wiki/Simple_DirectMedia_Layer

If I want to use that to write something cross-platform, what else do I need? Would I need to use it in addition to C/C++, or just alone?
__________________
Music: http://www.oquilluksound.com Album: http://machinefaultred.blogspot.com Album Calendar Youtube: http://www.youtube.com/oquilluksound

"but I promise you this, I'll always look out for you, that's what I do" -Coldplay
Phait is offline  
Old 02-14-2007, 10:31 AM   #12
Foxy
Re: Questions about C/C++
SDL is a toolkit for C/C++ innit? So... yeah....

SDL doesn't do Windows-like GUIs out of the box AFAIK btw. It's more for writing games (which do all their own graphics).
Foxy is offline  
Old 02-14-2007, 11:49 AM   #13
Theseus314
Re: Questions about C/C++
Quote:
Originally Posted by Phait View Post
I just remembered SDL
http://en.wikipedia.org/wiki/Simple_DirectMedia_Layer

If I want to use that to write something cross-platform, what else do I need? Would I need to use it in addition to C/C++, or just alone?
SDL does windowing for you, so you should be good to go.
Theseus314 is offline  
Old 03-14-2007, 05:28 PM   #14
Plagman

Plagman's Avatar
Re: Questions about C/C++
Quote:
Originally Posted by Foxy View Post
If you learn with VC++, you're stuck in the mold of using VC++.
Not quite. VC++ is a nicely integrated compiler/debugger/code editor trio that allows auto-completion, jumping to declarations, jumping to the different functions of a file in one click, comment/code blocks minimizing, interactive debugging along with a buttload of other stuff. There are tools that can generate code for you and window editors and stuff that effectively compels you to compile your application with VC++, but nothing forces you to use that. You are totally free to develop a OpenGL/SDL cross-platform game using MSVC : if your code is portable you'll just have to write the Linux Makefile and you'll be set. Frankly, I think MSVC is by far the most handy IDE available (I don't know about such products on Apple platforms though).
__________________
EDuke32 - "The corrupt doctrine of terror has begun."
Plagman is offline  
Old 03-14-2007, 07:34 PM   #15
Farlander
Re: Questions about C/C++
Quote:
Originally Posted by Plagman View Post
I don't know about such products on Apple platforms though.
Consider yourself fortunate.
Farlander is offline  
Old 03-15-2007, 02:40 AM   #16
theHunted
Re: Questions about C/C++
Well there's XCode on mac. Personally I don't like it as much as Visual Studio in terms of usability and productivity, but I guess that comes hand in hand when putting more time and effort into getting used to it. The only cool thing for me about XCode was the numerous Debuggig and Profiling tools. I just haven't come across anything similar to the unix based memory debugging tools on Windows.
__________________
M:I - New Dawn
a Max Payne 2 modification
theHunted is offline  
Old 03-15-2007, 05:20 AM   #17
Plagman

Plagman's Avatar
Re: Questions about C/C++
Yeah, I would kill to see stuff like valgrind integrated in MSVC.
__________________
EDuke32 - "The corrupt doctrine of terror has begun."
Plagman is offline  
Old 03-16-2007, 01:18 AM   #18
Destroyer
Re: Questions about C/C++
Quote:
Originally Posted by Phait View Post
Thanks.

Also it seems there is a Visual C++ Express edition that is completely free:
http://msdn.microsoft.com/vstudio/ex...ualc/features/
Visual C++ is not the same as Visual Studio.
I highly recommend learning Visual Studio its really good for C# which is soo good
for creating UI with Visual Studio tools.
Destroyer is offline  
Old 03-16-2007, 01:53 AM   #19
Phait

Phait's Avatar
Re: Questions about C/C++
So do they offer a free version?

It seems to me your suggestion is a difference that wouldn't matter to a beginner - just my take. If they both get the same end result what would it matter right?
__________________
Music: http://www.oquilluksound.com Album: http://machinefaultred.blogspot.com Album Calendar Youtube: http://www.youtube.com/oquilluksound

"but I promise you this, I'll always look out for you, that's what I do" -Coldplay
Phait is offline  
Old 03-16-2007, 03:02 AM   #20
theHunted
Re: Questions about C/C++
If you wanna code in c/c++ then Visual C++ (Express) is all you need really. Visual Studio is basically a big suit of software packages that allow programming in all kinds of languages. There's Visual Basic, Visual C, Visual C# and more but you don't really need any of that for c++ coding. Other than that I believe there's a couple of tools for cooperative coding (some sort of subversion system i guess) available, but again imho you don't need any of that stuff in your particular case. I would say you are just fine to go with Visual C++ Express Edition if you wanna do some c++ coding.

Quote:
Originally Posted by Destroyer View Post
I highly recommend learning Visual Studio...
What do you mean with "learning Visual Studio"? To me that kindof sounds like telling somebody to learn MS Office (Excel, Access, Powerpoint, Word) when he just wants to do some word processing. "Visual Studio" is just a bunch of editors for a couple of different programming languages.
__________________
M:I - New Dawn
a Max Payne 2 modification
Last edited by theHunted; 03-16-2007 at 04:23 AM.
theHunted is offline  
Old 03-16-2007, 08:42 PM   #21
Destroyer
Re: Questions about C/C++
ya he doesnt really need visual studio i guess if he just wants to do some light programming.
But VS is great for doing C# stuff, especially if he wants to do windows developement.
I dont know, I guess it just depends on how far he wants to go with it.
Destroyer is offline  
Old 03-17-2007, 09:24 AM   #22
8IronBob

8IronBob's Avatar
Re: Questions about C/C++
Oh yeah, Bloodshed makes a great C/C++ IDE and compiler. IIRC, Dev-C++ was somewhat built on the old DJGPP base. I'm not too sure how these are related, other than both being open-source. Then again, DJGPP was back in the old DOS days, and we all know that DOS is in the past, Dev-C++ is for Windows, and I believe there was a version for Linux, too, was there not?
__________________
PC Specs (a.k.a. "Galacticus Prime"): http://pcpartpicker.com/p/7Vk7FT
8IronBob is offline  
Old 03-17-2007, 03:36 PM   #23
Phait

Phait's Avatar
Re: Questions about C/C++
Quote:
Originally Posted by Destroyer View Post
I dont know, I guess it just depends on how far he wants to go with it.
I had a couple ideas so far and nothing trying to be original or extensive:

- Sokoban clone


You move the yellow crates into the squares with diamonds. You can't pull boxes away from a wall so you have to think strategically. Tile-based game with collision detection - simple enough.

- Program that will edit/update a number of specific TXT editable files, and allow user to specify the number(s) they want to change. (I.e. enabling handbrake in car files easily, in GTR 2 racing game)

- fullscreen game launcher, user specifies what game(s) to add and .JPG files for cover images (click a box cover and it launches the game - maybe have some kinda neat scroll-through effect, or something ala the iTunes album browser)

That's about the scope of development I'd like to do.
__________________
Music: http://www.oquilluksound.com Album: http://machinefaultred.blogspot.com Album Calendar Youtube: http://www.youtube.com/oquilluksound

"but I promise you this, I'll always look out for you, that's what I do" -Coldplay
Phait is offline  
Old 03-17-2007, 09:37 PM   #24
JackpotDen

JackpotDen's Avatar
Re: Questions about C/C++
dev c++ is good i used to use it, vb for c++ is what i use, kate is what i use in linux. pick and choose.

(currently year 1 games programming student)
__________________
Will you pick rifles, or computers?
JackpotDen is offline  
Old 03-19-2007, 12:38 AM   #25
Phait

Phait's Avatar
Re: Questions about C/C++
I installed VB 2005 Express and made an extremely simple web browser via the included tutorial(s).

So I publish it but it doesn't make an explicit .exe, it's like .exe.manifest or .exe.application or something silly like that. So I rename it to just .exe - and it works.

I uploaded it and had a friend try it and I figured this would happen: it wouldn't run for her cause she needed the .net framework.

Which isn't an extremely small download - but here's my point: how can you make a VB app without any such dependencies? I know you could just bundle .net with it, but if the app is like 40kb and .net is what 20mb - that's kinda silly.
__________________
Music: http://www.oquilluksound.com Album: http://machinefaultred.blogspot.com Album Calendar Youtube: http://www.youtube.com/oquilluksound

"but I promise you this, I'll always look out for you, that's what I do" -Coldplay
Phait is offline  
Old 03-19-2007, 01:50 AM   #26
Destroyer
Re: Questions about C/C++
you have to make sure you package everything with the EXE. usually when you build in Visual studio(VB Express is a sub part of that) it will do it under debug.
ya i know its weird that .net stuff can be alot. but there might be a way aroudn it it doesnt make sense that even the smallest app be 20mb.
Destroyer is offline  
Old 03-25-2007, 08:52 AM   #27
Phait

Phait's Avatar
Re: Questions about C/C++
nm...
__________________
Music: http://www.oquilluksound.com Album: http://machinefaultred.blogspot.com Album Calendar Youtube: http://www.youtube.com/oquilluksound

"but I promise you this, I'll always look out for you, that's what I do" -Coldplay
Last edited by Phait; 03-25-2007 at 09:31 AM.
Phait is offline  
Old 04-06-2007, 06:58 PM   #28
Killd a ton

Killd a ton's Avatar
Re: Questions about C/C++
tell her to get .net 1.1 and 3.0, se will probably have to eventualy (vista comes with both and xp sp2 as 1.1 I belive, it looks like a lot of appes will be coming out that will requre .net an then she would have to get it any way, though it might be included on a cd or something, thell here to update here computer as well :P.

if you want to have an app that dosent requre .net then stick to c++ or digg up the old vb 6.0
one benefit of .net apps is that they share the 20mb so they will be smaler to distribut and take up a smaler memory foot print then vb 6.0 (same goes for c# and other .net compiled languaches) another grate thing is that programs coded in the different .net languages will work togeather but a down side is that you are limited to windows nt, ce win32 and some limited unix as wll, so it wount be portable to linux or mac, not yet any way.
__________________
hell-angel: "I would sig this if I had the room."

Duke 3D art to do list
New and improved.
Killd a ton is offline  
Old 04-13-2007, 05:42 AM   #29
derail
Guest
Re: Questions about C/C++
Writing your apps in notepad and compiling with the DOS version of GCC should work pretty well too.
 
Old 04-13-2007, 09:44 AM   #30
Foxy
Re: Questions about C/C++
You work without syntax highlight?

Better you than me dude.
Foxy is offline  
Old 04-15-2007, 01:54 AM   #31
Destroyer
Re: Questions about C/C++
Quote:
Originally Posted by derail View Post
Writing your apps in notepad and compiling with the DOS version of GCC should work pretty well too.
I have to disagree. the intelisense in VS rocks. I say he should just get VS.
Destroyer is offline  
Old 04-16-2007, 08:44 AM   #32
NetNessie

NetNessie's Avatar
Re: Questions about C/C++
If your up for hand-coding, there's always Notepad++. It offers tons of stuff, completely free and even runs from a USB if you want to take it with you places.

I use it for all my java work because I can't stand editing in a terminal.
__________________
Ink Grass LazyMoon Photography
"Say something wise, and your name will be remembered forever." - Anonymous
NetNessie is offline  
Old 04-17-2007, 11:12 AM   #33
DeeperThought

DeeperThought's Avatar
Re: Questions about C/C++
I'm new to programming. It looks like my easiest option for doing little games in Windows would be C# with VS (the free version). Is there any reason why I should start with C++ instead?
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline  
Old 04-17-2007, 03:06 PM   #34
Phait

Phait's Avatar
Re: Questions about C/C++
People will say yeah start with C or C++ because everything is a derivative from those (learn from ground up) but I think that's BS because if C# etc. include everything that C/C++ has what's the diff?
__________________
Music: http://www.oquilluksound.com Album: http://machinefaultred.blogspot.com Album Calendar Youtube: http://www.youtube.com/oquilluksound

"but I promise you this, I'll always look out for you, that's what I do" -Coldplay
Phait is offline  
Old 04-18-2007, 03:23 AM   #35
Plagman

Plagman's Avatar
Re: Questions about C/C++
If you don't care about portability at all, I'd say .net C# with Microsoft tools for making games is a fine way to go. If you do, use C++ with SDL or another multi-platform all-in-one library and your code should be easy to port.
__________________
EDuke32 - "The corrupt doctrine of terror has begun."
Plagman is offline  
Old 04-18-2007, 05:59 AM   #36
Killd a ton

Killd a ton's Avatar
Re: Questions about C/C++
C++ is 5% fater then c#, c# is easyer to debug and more secure, probably also more staible.
__________________
hell-angel: "I would sig this if I had the room."

Duke 3D art to do list
New and improved.
Killd a ton is offline  
Old 04-18-2007, 06:41 AM   #37
Foxy
Re: Questions about C/C++
Isn't security and stability dependant on the programmer?
Foxy is offline  
Old 04-18-2007, 07:44 AM   #38
Killd a ton

Killd a ton's Avatar
Re: Questions about C/C++
Well theres a difference to how memory is handled in .net programs witch adds some securety, but your right in that a c# program isn't automaticaly more secure then a c++ program.
As for stability, since .net is compiled at run time (well partialy), a bug in the compiler could be fixed and have effect with out the need to recompile and redistribute the actual progam (but you could probably state the oposide with the same facts).
__________________
hell-angel: "I would sig this if I had the room."

Duke 3D art to do list
New and improved.
Killd a ton is offline  
Old 04-20-2007, 01:32 PM   #39
Destroyer
Re: Questions about C/C++
Quote:
Originally Posted by DeeperThought View Post
I'm new to programming. It looks like my easiest option for doing little games in Windows would be C# with VS (the free version). Is there any reason why I should start with C++ instead?
actually if you are new to programming and you want to make a game, Id recommend Python. theres some nice libraries for that.
or C++ with GLUT and OpenGL. GLut wraps win32 stuff so makes it easier.
Destroyer is offline  
Old 04-20-2007, 02:12 PM   #40
DeeperThought

DeeperThought's Avatar
Re: Questions about C/C++
Quote:
Originally Posted by Destroyer View Post
actually if you are new to programming and you want to make a game, Id recommend Python. theres some nice libraries for that.
or C++ with GLUT and OpenGL. GLut wraps win32 stuff so makes it easier.
I've just started trying to work through some tutorials on using SDL with C++. I haven't invested much time yet, and it's not too late for me to switch. But what would be the advantage of using GLUT over SDL? Or Python for that matter?
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 08:18 AM.

Page generated in 0.23002911 seconds (100.00% PHP - 0% MySQL) with 18 queries

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.

Website is 1987-2014 Apogee Software, Ltd.
Ideas and messages posted here become property of Apogee Software Ltd.