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

0 Members and 3 Guests are viewing this topic.

Charles Pegge

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #15 on: June 21, 2011, 09:36:44 PM »

Yes. I see this happens when more than one window is run at the same time. Something gets locked in at the OS level. PortViewer2 does not show this behaviour so we do have a comparative model to work with.

Charles

kryton9

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #16 on: June 21, 2011, 10:17:58 PM »
I terminated all the services running. And when I ran it just once and exited, it still left it as a service. I didn't restart, will restart my computer and do a test one more time with only 1 run to verify, it isn't from the perviouse executions...

Ok, back after the restart and test. Yes it still leaves it running in services. Hope it helps track down the culprit :)
« Last Edit: June 21, 2011, 10:22:09 PM by kryton9 »

kryton9

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #17 on: June 21, 2011, 10:32:05 PM »
I didn't want to end my night with a problem, so the amazing thing I noticed is your executable Charles is 4K less than my code generated with MingW32 with the optimize for size flag turned on. That really impresses me! Kudos to you!!!
« Last Edit: June 21, 2011, 10:40:28 PM by kryton9 »

Charles Pegge

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #18 on: June 21, 2011, 11:57:26 PM »

Solved it!

I added a WM_DESTROY and a PostQuitMessage, and also prevent callbacks during the destroy process.

There are 2 IsRunning modes for the HandleMessages: one with Callbacks (2) and without callbacks (1)

Charles

kryton9

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #19 on: June 22, 2011, 02:14:01 AM »
Charles, I couldn't get it to compile. I might be missing some stuff from my Oxygen.

Also, I was thinking. Just name this GLWindowClass instead of zxGLWindowClass. I don't want to mix up zx stuff with your nice clean minimal core of oxygen. I can always derive my class from GLWindow.
I will go back and change my previous posts so that it won't confuse future users.

[attachment deleted by admin]
« Last Edit: June 22, 2011, 02:19:18 AM by kryton9 »

Charles Pegge

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #20 on: June 22, 2011, 03:12:36 AM »
It looks as though it cannot find minwin. It should map correctly when you put the zx folder inside the projects folder.

I am still refining the code and making a few more adjustments to Oxygen. The exercise is to make the test 100% OOP, and ensure that functions inside classes have direct access to all the static members.

Yes we can make it GLWindow. This project folder is going to be quite volatile.

Charles

« Last Edit: June 22, 2011, 04:00:30 AM by Charles Pegge »

kryton9

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #21 on: June 22, 2011, 08:44:59 PM »
I don't think I have the latest minwin.inc. I couldn't find the download link for the "in progress version". I am still using the last latest alpha 35

Ok, figured out something that caused confusion. The attached photo will show. The link for downloads takes us to an old page.

these links also point to old files:
http://oxygenbasic.sourceforge.net/

http://sourceforge.net/projects/oxygenbasic/

[attachment deleted by admin]
« Last Edit: June 22, 2011, 08:56:59 PM by kryton9 »

Charles Pegge

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #22 on: June 22, 2011, 11:22:14 PM »

Kent. Currently I only post the In-progress version to the OxygenBasic website. And SourceForge may lag by one version.

http://www.oxygenbasic.org/downloads.htm

Charles

kryton9

  • Guest
This compiles fun, but won't run.
« Reply #23 on: June 25, 2011, 12:08:05 AM »
Charles,

I went through and cleaned up the code to the way I like it so I could use it. There are a few places where I made slight changes, mainly in functions/methods where you had it like:
funcName
(
     ...
    list of parameters
    ... )

I made them;
funcName(  ...
    list of parameters
    ... )

Anyways this code won't run, so make sure you save it in another folder somewhere.

My guess is the ()

I noticed in most cases you can get by without them, but then in others you must use them.
I can imagine how hard that must be to parse that stuff. But it would be nice to have it standardized, either use them all the time or all the time to eliminate confusion.

[attachment deleted by admin]

Charles Pegge

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #24 on: June 25, 2011, 01:34:18 AM »

Hi Kent,

Fixed your program.

No problem with the prototype syntax.

You need to use the ":=" when assigning/comparing. Example:

            if not PixelFormat := ChoosePixelFormat hDC, @pfd then


Also missing dim:

WNDCLASS winClass

Charles

kryton9

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #25 on: June 25, 2011, 01:20:47 PM »
Thanks Charles, oh didn't know about := 
I saw it but thought you were just testing the parser and that = was still allowed.

Thanks again as I will use this code to build upon a lot.

Charles Pegge

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

I made a few more changes in the projects/GLWindows version, while fine-tuning Oxygen.

There are two ways to create class static variables. The first is to use the word static. This adds them to the class static table (which also contains method addresses). This second is to use the word dim. Class dim variable are visible inside the class but never outside. But you can of course use methods to access any of these indirectly. I think this is going to be the only reliable way of accessing statics.


Charles


kryton9

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #27 on: June 25, 2011, 09:12:41 PM »
Sounds good Charles, once it is tested and you feel good with it, will add that to the quick reference I am putting together.

Now I call upon the Oracle of Oxygen...
I cleaned up and tried to make the class file and test program as clean as possible. I went through it 3 times and as far as I can tell it should work.
I am getting an error.

I tried using () after GetWidth, but it still didn't work.
« Last Edit: June 25, 2011, 11:01:26 PM by kryton9 »

kryton9

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #28 on: June 25, 2011, 11:05:13 PM »
I renamed the download and files in the previous post. This will represent the class well. glSimpleWindowClass
This is because it combines some thing to make it simple for quick gl tests. For instance in the final glWindowClass
font will be pulled out into its own class. Also a timer class will be added to the final advance class.

With the timer class in place, even when you minimize the program, it will animate in the minimized preview that Windows 7 provides :)
It will be cool.

Charles Pegge

  • Guest
Re: my simple glwindow class in c++ for conversion
« Reply #29 on: June 26, 2011, 03:08:38 AM »
Hi Kent,

Lost a few essential brackets, and a few other problems.

Named parameters require brackets f(a=4,b=4)

Also when using functions in an expression like this: a=f()*b.

Full screen mode was irrecoverable and required a PC restart.

If you want to refactor I can feed the changes into the current code.

There is a styling program we can adapt for producing preferred code layout.

What are your preferences?

Charles
« Last Edit: June 26, 2011, 09:20:29 AM by Charles Pegge »