c++ - int main() running constantly -


I'm new to c ++, so I apologize if this is a stupid question but I do not seem to answer Could it For a while I have been using the processing and want to start using C ++ because I have heard that it is fast and the program I created is too long / dense for processing to run at the right speed .

In processing, there is a setup zero which runs once and then draw zero which then runs continuously. To make a remake of a program in C ++ (a chess AI) I need to use it and I need it.

Is there a way to continuously run the intestine? If it does not happen, then I call a function that will go continuously?

Besides, is there a way to pop up a program, when you run a program that can attract geometry? (I will need to make pieces that can be ideally manipulated by the mouse)

The way I am using Xcode

< Div class = "post-text" itemprop = "text">

main () should usually be set up and then start the main message processing loop provided by your toolkit. . The message processing loop will continue to run until the user requests to leave your app (or you ask the toolkit to close your app).

Your toolkit will call your Draw Function whenever your window needs to be featured. For example, if you were using the GLUT Toolkit (for OpenGL, Mac, Windows, a very popular Drawing API supported on Linux), then it will call other functions, when user input such as press or mouse clicks . and many mobile devices), your main function can look like this ():

  void main {int argc, char ** argv} {glutInit (& argc, argv) ; GlutInitDisplayMode (GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA); GlutInitWindowPosition (100100); GlutInitWindowSize (500,500); Glut Creetwondo ("My First Open GL Program"); GlutDisplayFunc (render); GlutMainLoop (); }   

For the Cocoa, OSX native API, it may look like this ():

  #import & lt; Cocoa / Cocoa H & gt; Int main (int argc, const char ** argv) {back to nasp prefiguration (argc, argv); }    

Comments