3 Replies - 466 Views - Last Post: 19 December 2013 - 03:07 PM Rate Topic: -----

#1 Java Student  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 483
  • Joined: 05-February 10

What do i need to use in order to make this program?

Posted 18 December 2013 - 04:09 PM

Just for my portfolio and experience, I'm making a C++ program that is capable of generating relatively simple RSA keys, encrypting and decrypting files, then storing those keys on my MySQL database via PHP through MySQL's C++ connector. I have an intermediate understanding of both C++ and PHP/MySQL, but the problem is when I try to figure out which window method to use, OpenGL, SDL, winmain?

I have only ever used OpenGL and SDL for window rendering, but this method of using winmain has come to my attention which I know very little about.

But the code for WinMain
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow );


looks about 10 years deprecated to me and I only ever see it used in historic window rendering so I'm wondering if it's still in use today and if you think it will suit my needs?

Thanks~!

Is This A Good Question/Topic? 0
  • +

Replies To: What do i need to use in order to make this program?

#2 vividexstance  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 687
  • View blog
  • Posts: 2,377
  • Joined: 31-December 10

Re: What do i need to use in order to make this program?

Posted 19 December 2013 - 11:26 AM

Maybe someone more familiar with the Windows API can answer this. But there are libraries that abstract this away so you can focus on what you're trying to do.
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3666
  • View blog
  • Posts: 11,497
  • Joined: 05-May 12

Re: What do i need to use in order to make this program?

Posted 19 December 2013 - 02:32 PM

Nope. It's not deprecated. It's still the same entry point for all Windows programs just like main() is still the standard entry point for C and C++ console programs. The explicit window class registration, window creation, and message pumping is still present in all Windows programs as well. As vividexstance noted, there are frameworks that try to abstract this away from you and let you try to focus on what your program needs to do.
Was This Post Helpful? 0
  • +
  • -

#4 Java Student  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 21
  • View blog
  • Posts: 483
  • Joined: 05-February 10

Re: What do i need to use in order to make this program?

Posted 19 December 2013 - 03:07 PM

Oh ok I think I understand.

Which way would you suggest, either OpenGL or winmain(), for the needs of building textboxes, buttons, easy text rendering? Or I guess which one do you believe provides the easiest GUI libraries to do this functionality since neither option has them built-in?

To me, it seems like OpenGL gives me the most freedom in terms of customization if you're willing to deal with the I/O of the mouse and keyboard functions of things like textboxes and buttons:
void drawTextBox(int fromLeft, int fromTop, int width, int height) {
    glColor3f(1.0f, 1.0f, 1.0f);
    glBegin(GL_QUADS);
        glTexCoord2f(0, 0);
        glVertex2i(fromLeft, fromTop);  // Upper Left
        glTexCoord2f(1, 0); 
        glVertex2i(fromLeft - width, fromTop);  // Uppright
        glTexCoord2f(1, 1); 
        glVertex2i(fromLeft - width, fromTop + height);  // Bottom right
        glTexCoord2f(0, 1); 
        glVertex2i(fromLeft, fromTop + height); // bottom left
    glEnd();
}


This post has been edited by Java Student: 19 December 2013 - 03:07 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1