السلام عليكم ورحمة الله وبركاته
ممكن اعرف مالفرق بين الapplicion وبين برامج الconsol
حيث انه لدي مشروع بالapplicition واريد ان اضيف عليه تعديلات من برامج اخرى بالconsol
حيث ان الmain في الاببليكيشن هي كالتالي:
- int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
- {
- WNDCLASSEX windowClass; // window class
- HWND hwnd; // window handle
- MSG msg; // message
- bool done; // flag saying when our app is complete
- DWORD dwExStyle; // Window Extended Style
- DWORD dwStyle; // Window Style
- RECT windowRect;
- // temp var's
- int width = 800;
- int height = 600;
- int bits = 32;
- //fullScreen = TRUE;
- windowRect.left=(long)0; // Set Left Value To 0
- windowRect.right=(long)width; // Set Right Value To Requested Width
- windowRect.top=(long)0; // Set Top Value To 0
- windowRect.bottom=(long)height; // Set Bottom Value To Requested Height
- // fill out the window class structure
- windowClass.style = CS_HREDRAW | CS_VREDRAW;
- windowClass.lpfnWndProc = WndProc;
- windowClass.cbClsExtra = 0;
- windowClass.cbWndExtra = 0;
- windowClass.hInstance = hInstance;
- windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); // default icon
- windowClass.hCursor = LoadCursor(NULL, IDC_ARROW); // default arrow
- windowClass.hbrBackground = NULL; // don't need background
- windowClass.lpszMenuName = NULL; // no menu
- windowClass.lpszClassName = "MyClass";
- windowClass.hIconSm = LoadIcon(NULL, IDI_WINLOGO); // windows logo small icon
- // register the windows class
- if (!RegisterClassEx(&windowClass))
- return 0;
- if (fullScreen) // fullscreen?
- {
- DEVMODE dmScreenSettings; // device mode
- dmScreenSettings.dmPelsWidth = width; // screen width
- dmScreenSettings.dmPelsHeight = height; // screen height
- dmScreenSettings.dmBitsPerPel = bits; // bits per pixel
- dmScreenSettings.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;
- //
- if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
- {
- // setting display mode failed, switch to windowed
- MessageBox(NULL, "Display mode failed", NULL, MB_OK);
- fullScreen=FALSE;
- }
- }
- if (fullScreen) // Are We Still In Fullscreen Mode?
- {
- dwExStyle=WS_EX_APPWINDOW; // Window Extended Style
- dwStyle=WS_POPUP; // Windows Style
- ShowCursor(FALSE); // Hide Mouse Pointer
- }
- else
- {
- dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; // Window Extended Style
- dwStyle=WS_OVERLAPPEDWINDOW; // Windows Style
- }
- AdjustWindowRectEx(&windowRect, dwStyle, FALSE, dwExStyle); // Adjust Window To True Requested Size
- // class registered, so now create our window
- hwnd = CreateWindowEx(NULL, // extended style
- "MyClass", // class name
- "Texture Example 2: The Waving Flag Example", // app name
- dwStyle | WS_CLIPCHILDREN |
- WS_CLIPSIBLINGS,
- 0, 0, // x,y coordinate
- windowRect.right - windowRect.left,
- windowRect.bottom - windowRect.top, // width, height
- NULL, // handle to parent
- NULL, // handle to menu
- hInstance, // application instance
- NULL); // no extra params
- // check if window creation failed (hwnd would equal NULL)
- if (!hwnd)
- return 0;
- ShowWindow(hwnd, SW_SHOW); // display the window
- UpdateWindow(hwnd); // update the window
- done = false; // intialize the loop condition variable
- Initialize(); // initialize OpenGL
- // main message loop
- while (!done)
- {
- PeekMessage(&msg, hwnd, NULL, NULL, PM_REMOVE);
- if (msg.message == WM_QUIT) // do we receive a WM_QUIT message?
- {
- done = true; // if so, time to quit the application
- }
- else
- {
- if (keyPressed[VK_ESCAPE])
- done = true;
- else
- {
- Render();renderScene();
- TranslateMessage(&msg); // translate and dispatch to event queue
- DispatchMessage(&msg);
- }
- }
- }
- free(bitmapData);
- if (fullScreen)
- {
- ChangeDisplaySettings(NULL,0); // If So Switch Back To The Desktop
- ShowCursor(TRUE); // Show Mouse Pointer
- }
- return msg.wParam;
- }
والmain في الكونسول هي كالتالي:
- int main(int argc, char **argv)
- {
- glutInit(&argc,argv);
- glutInit(&argc, argv);
- glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA);
- glutInitWindowPosition(100,100);
- glutInitWindowSize(400,400);
- glutCreateWindow("sdfghjkjhgfdsdfghj");
- glutDisplayFunc(renderScene);
- glutReshapeFunc(changeSize);
- glutTimerFunc(0,timer,1000);
- glutMainLoop();
- return(0);
- }
المين الاولى لبرنامج بالابلكيشن وانا اريد ان اضيف له ساعه رقميه لكن الساعه الرقميه بالكونسول كيف ادمجهم مع بعض
بليز حلو لي هذه المشكلة والله اني بحثت عنها بس ما فيه اي شي عنها..
اذا فيه اي شي مو واضح قولولي عشان اوضح لكم
