Author Topic: my simple glwindow class in c++ for conversion  (Read 10944 times)

0 Members and 2 Guests are viewing this topic.

kryton9

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #30 on: June 26, 2011, 01:12:36 PM »
Thanks, I wasn't sure when () were needed and when not. Having simple rules as below is very beneficial. I will add to my notes.

About styles, I see how you and Peter came up with your style because you guys do assembly programming and work in plain text editors.
In viewing code in just black and white with no color highlighting, your style makes sense and is easier to read.
I find that when you use assembly style with highlighted syntax it is very hard to read.

I think the indented, 4 spaces, with highlighted syntax looks nice and is easy to read. Since I was using c++ the last 2 years or more
I got used to naming things differently because of case matters. I do prefer programming in case doesn't matter languages like BASIC,
but have to get used to it again.

I would hold off on an established style till we do some more real world classes to see what we come up against. As you saw, I came up
with a different naming scheme for variables than what we started out with. Will need to see how it works with other classes.

I will work on glSimpleWindowClass more today to see if I can get it working with your new tips. I also found a nice sub you have
in minwin for deleting libraries, so I changed my code to use that. So no more freelibrary in the class code, I call your sub and noted it in the code.

kryton9

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #31 on: June 26, 2011, 03:19:01 PM »
Charles, I couldn't get my latest to work.
So I went back to reply # 24 in this thread and got your version. It runs, but Fullscreen does not work now.

So I then went back to reply #18 and got that version and that one doesn't run properly at all.

So something in the in progress oxygen has changed to mess them up, at least that is what seems to be?

Charles Pegge

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #32 on: June 26, 2011, 09:25:09 PM »

Hi Kent,

The full screen problem is fixed on this line
sc.dmSize       = sizeof sc

I assigned the wrong variable!

I would like to localise a few more variables in the WinCreate method, taking them out of the shared static space.

This also gets me thinking about refactoring tools. So we have a means of changing names safely as well as automating code layout adjustments.

I will post another update very shortly and let you know.

Charles

kryton9

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #33 on: June 26, 2011, 09:30:36 PM »
I will wait for you to refactor things the way you want. That is the good thing about doing things like this is that it helps test out existing coding and framework and gives one better ideas about how to pull things out. Just like in doing glSimpleWindow, it is obvious that Font should be a separate class. As Timer will be. I am working on a timer class now. I got it written out but not compiling. I will post what I have before going to sleep, but I will be up for a few more hours.

Aurel

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #34 on: October 18, 2012, 11:59:08 AM »
I just peek into this topic and found some points
about how create multiple windows - am i right about this ?
or is missunderstand some things ..im not sure.

Similar thing i trying to do with standard windows ( not using openGL) but
i constantly stuck... >:(
So is there finished exemple about this thematic?
There's not matter if is openGL ..and OOP way
I just want to know how do this things and how stuff works...

Aurel

PS. maybe is this only way to minimize window coding and encapsulate wndProc with
just ordinary function or sub... :-\