Jump to content

What is C++ for?


Dasttann777
 Share

Recommended Posts

What is C++ used for? How do you make a game like WoW? Everyone says that is not good to make gui's with C++, but Guis are my favorite! What can it do, seeing that Most Software requires a User Interface for the User?

Check out my new site!Current Projects:[list][*]Hunter Console - A Small Gadget[*]HunterPad - Basic Notepad aimed at Programmers[*]Betters UP! - Betting Game[/list]
Link to comment
Share on other sites

What is C++ used for?

Was that a rhetorical question?

Who said C++ isn't good for UI creation? I'm currently using Opera which is written in C++ and that has a fancy UI.

Edit: This is a limited list, but you can clearly see C++ is used quite a lot in software development.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

You can make GUIs in almost any language. It just depends how much work you are willing to do. Don't expect something like AutoIt where most of the hard work is done for you (in C++ by the way) and you only have to call some very easy functions.

C++ is the dominant general programming language in the world today I imagine (though I haven't see the stats recently). It is powerful, far more so than AutoIt, and of course it can make GUIs using a number of toolkits (in most cases just the Windows API, but you'll a lot of GTK+ apps as well).

Link to comment
Share on other sites

I didnt mean to come across rude, but I was more just wondering.

I didn't think you were rude, just misled.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Yes, C++ is Cross-platform. Read the wiki entry to learn more.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

C++ is the dominant general programming language in the world today I imagine (though I haven't see the stats recently).

The stats recently.

@OP, you have to be patient. First you learn programming, then you learn to make games. Doing both at once, some people have done it, but they're either not very good programmers or not very good game designers.

I started game programming with C# + XNA using this tutorial. It's extremely lacking in teaching you how to program well, but it does teach you how to draw 2D and 3D objects. Don't start with this if you don't already have decent object oriented programming experience. (The tutorial ends with a single 624 line file with one class containing about 30 declarations and 15 methods.)

If you need programming experience, you may as well stick with AutoIt for a year and then explore other languages. There are no "automatic winner" beginner languages, but something imperative, dynamic and weakly typed will get you a long way with relative little effort.

Edited by Manadar
Link to comment
Share on other sites

That's a lot of people still using C. I wonder how many of those results is people not making the distinction between the two clear, on stackoverflow one of the most common problems is people that tag a question "C/C++" when it applies to just one of them.

I wondered the same thing. If I must guess, I would say a lot. Perhaps bringing C++ to #1?
Link to comment
Share on other sites

Thats a very simple test though.

Right, very simple. A more useful comparison would be the popularity among windows programmers since AutoIt cannot be used on Unix/Linux. The Google search cannot respect that fact.

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Why isn't there a mention of AutoIt?

What do you think where it would be positioned if included in survey?

I checked if AutoIt could be added but they say AutoIt should be presented on the other sites they mention. AutoIt is not on many of them.

This is one of the downsides of having everything in one big forum. Quite a lack of exposure.

Edited by Manadar
Link to comment
Share on other sites

You can make GUIs in almost any language. It just depends how much work you are willing to do. Don't expect something like AutoIt where most of the hard work is done for you (in C++ by the way) and you only have to call some very easy functions.

WTL begs to differ. MFC does too although I don't like MFC bloat. I'd argue that WTL and/or MFC present better APIs than AutoIt does because AutoIt's GUI relies on too much auto-magic bullshit and lots of buggy shit code to do things.
Link to comment
Share on other sites

Right, very simple. A more useful comparison would be the popularity among windows programmers since AutoIt cannot be used on Unix/Linux. The Google search cannot respect that fact.

I disagree. I think all platforms should be taken into account. If AutoIt was available for linux tomorrow then by the above logic it would become less popular overnight.

WTL begs to differ. MFC does too although I don't like MFC bloat. I'd argue that WTL and/or MFC present better APIs than AutoIt does because AutoIt's GUI relies on too much auto-magic bullshit and lots of buggy shit code to do things.

You will still have to deal with other language features, like types, that AutoIt covers up. I won't argue with "better" APIs, but I haven't seen anything easier (particularly for people with no programming experience) than AutoIt yet. Edited by Mat
Link to comment
Share on other sites

To make a game like Wow:

- you need packages, headers, and systems, that are tested and comfortable for you and your team.

- you'll use systems that already work and you'll write your own.

- I write a bunch of functions and classes, such as:

int winselect=-1;
bool dragging=0;
int buttonw=-1, buttonid=-1;
class windowclass {
public:
int x, y, w, h;
int windisx, windisy;
int buttons;
bool nodrag;
#define buttonmax 30
SDL_Rect button[buttonmax];
char buttonlable[buttonmax][256];
SDL_Surface *buttonpic[buttonmax];
SDL_Surface *surf, *_surf;
windowclass *wdrag;
int lbuttonid;
int rbuttonid;
windowclass() {
  x=0; y=0; w=0; h=0;
  windisx=0; windisy=0;
  int i=0;
  buttons=0;
  nodrag=0;
  for(i=0; i<buttonmax; i++) {
   button[i].x=0; button[i].y=0;
   button[i].w=0; button[i].h=0;
   buttonpic[i]=NULL;
  }
  memset(buttonlable, NULL, sizeof(buttonlable));
  surf=NULL; _surf=NULL;
  wdrag=NULL;
  lbuttonid=-1;
  rbuttonid=-1;
}
windowclass::makewindow(int x, int y, int w, int h, int type, int red, int green, int blue, int alpha);
windowclass::addbutton(int x, int y, int w, int h);
windowclass::addbutton(SDL_Rect rect, char *lable);
windowclass::addbutton(SDL_Rect rect);
draw();
int drag();
int drag(bool &redraw);
clearwin(int x, int y, int w, int h);
clearwin();
drawbackup();
};
windowclass::clearwin()
{
int i=0;
sge_Blit(_surf, surf, 0, 0, 0, 0, w, h);
}
windowclass::clearwin(int x, int y, int w, int h)
{
sge_Blit(_surf, surf, x, y, x, y, w, h);
}
windowclass::addbutton(int x, int y, int w, int h)
{
button[buttons].x=x;
button[buttons].y=y;
button[buttons].w=w;
button[buttons].h=h;
if(buttons<buttonmax-1) buttons++;
}
windowclass::addbutton(SDL_Rect rect)
{
button[buttons]=rect;
if(buttons<buttonmax) buttons++;
}
windowclass::addbutton(SDL_Rect rect, char *lable)
{
button[buttons]=rect;
strcpy(buttonlable[buttons], lable);
if(buttons<buttonmax) buttons++;
}
int windowclass::drag()
{
int i=0;
if(mbDown[mbLEFT]==1) {
  if(dragging==0) {
   if(mouseoverrect(x, y, w, h)) {
    if(buttons>0) {
     for(i=0; i<buttons; i++) {
      if(mouseoverrect(x+button[i].x, y+button[i].y, button[i].w, button[i].h)) {
       return i;
      }
     }
    }
    SDL_GetMouseState(&mousex, &mousey);
    windisx = mousex - x;
    windisy = mousey - y;
    dragging=1;
    wdrag=this;
   }
  }
}
if(wdrag==this && dragging && !nodrag) {
  SDL_GetMouseState(&mousex, &mousey);
  x = mousex-windisx;
  y = mousey-windisy;
}
if(mbDown[mbLEFT]==0) {
  dragging=0;
  wdrag=NULL;
}
return -1;
}
int windowclass::drag(bool &redraw)
{
int i=0;
if(mbDown[mbLEFT]==1) {
  if(dragging==0) {
   if(mouseoverrect(x, y, w, h)) {
    if(buttons>0) {
     for(i=0; i<buttons; i++) {
      if(mouseoverrect(x+button[i].x, y+button[i].y, button[i].w, button[i].h)) {
       lbuttonid = i;
       return i;
      }
     }
    }
    SDL_GetMouseState(&mousex, &mousey);
    windisx = mousex - x;
    windisy = mousey - y;
    dragging=1;
    wdrag=this;
   }
  }
}
if(mbDown[mbRIGHT]==1) {
  if(dragging==0) {
   if(mouseoverrect(x, y, w, h)) {
    if(buttons>0) {
     for(i=0; i<buttons; i++) {
      if(mouseoverrect(x+button[i].x, y+button[i].y, button[i].w, button[i].h)) {
       rbuttonid=i;
       return i;
      }
     }
    }
    SDL_GetMouseState(&mousex, &mousey);
    windisx = mousex - x;
    windisy = mousey - y;
    dragging=1;
    wdrag=this;
   }
  }
}
if(wdrag==this && dragging && !nodrag) {
  SDL_GetMouseState(&mousex, &mousey);
  x = mousex-windisx;
  y = mousey-windisy;
  redraw=1;
}
if(mbDown[mbLEFT]==0) {
  dragging=0;
  wdrag=NULL;
}
return -1;
}
windowclass::draw() {
if(surf!=NULL) {// if surface of win[i] NOT = NULL then draw win[i].surf
  sge_Blit(surf, screen, 0, 0, x, y, w, h);
}
}
windowclass::makewindow(int x, int y, int w, int h, int type, int red, int green, int blue, int alpha)
{
int i=0;
if(surf!=NULL) {
  //SDL_FreeSurface(surf);
}
surf = createsurface(w, h);
switch(type) { // This type variable is used to draw the surface of win
case 0: { // case 0 do not fill window surface with any background colors
  NULL;
break;}
case 1: {//draws colored lines from top and bottom getting brighter on window surface
  for(i=0; i<h/2+1; i++) {
   sge_HLine(surf, 0, surf->w-2, i, int(i* 255/h*2)* red, int(i* 255/h*2)*green, int(i* 255/h*2)*blue);
   sge_HLine(surf, 0, surf->w-2, h-i, int(i* 255/h*2)* red, int(i* 255/h*2)*green, int(i* 255/h*2)*blue);
  }
break;}
case 2: {//draws colored lines from top and bottom getting brighter on window surface
  for(i=0; i<h/2; i++) {
   sge_HLine(surf, 1, surf->w, 1+i,127* red, 127*green , 127*blue);
   sge_HLine(surf, 1, surf->w, h-i-1,127* red, 127*green , 127*blue);
  }
break;}
}//end switch(type)
sge_Rect(surf, 0, 0, surf->w-1, surf->h-1, 255, 0, 0);
SDL_SetAlpha(surf, SDL_SRCALPHA, alpha);
windowclass::x=x;
windowclass::y=y;
windowclass::w=w;
windowclass::h=h;
_surf = sge_copy_surface(surf);
}
windowclass::drawbackup()
{
freesurf(_surf);
_surf = sge_copy_surface(surf);
}

I package it all in a template let's say SDL_Template.h, SDL_Template.hh. Then I start my projects in the way I left off of the last one.

You can't just jump into making a game like Wow, you'll hurt yourself.

You need a team and a viable plan. You're also going to need funding for living space, electricity, (internet helps), spaghetti, pop tarts, and coffee.

Wow has money, lets just say allot. Programmers are paid to contribute to the project. I liked it better when gamers were developing games that they wanted to play.

- Rock'n Roll Racing

- Lost Vikings

- Blackthorne

- Diablo 1, 2

They got paid too, but it was different then.

(fuck MFC I wrote my own windowclass)

Of course I say that because I am not comfortable using MFC with SDL

Edited by Xandy
Link to comment
Share on other sites

For the OP

if you need to ask what C++ is then you are a long way from the point of having to worry about writing a game.

Hit the books, study hard and someday you too will be able to write "Hello World".

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

For the OP

if you need to ask what C++ is then you are a long way from the point of having to worry about writing a game.

Hit the books, study hard and someday you too will be able to write "Hello World".

Lol I can Write basic functions, I am not that new, I was just wondering....
Check out my new site!Current Projects:[list][*]Hunter Console - A Small Gadget[*]HunterPad - Basic Notepad aimed at Programmers[*]Betters UP! - Betting Game[/list]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...