Author Topic: Nehe tutorial in a dynamic dialog  (Read 7733 times)

0 Members and 1 Guest are viewing this topic.

Arnold

  • Guest
Nehe tutorial in a dynamic dialog
« on: February 25, 2018, 04:46:15 AM »
This is Nehe tutorial 8, modified a little bit and done using dynamic dialog templates. It should run in JIT mode, and run as a 32-bit and 64-bit exe. First there must be loaded an image, then start animation with Ctrl-P or Menuitem, then the keys can be used. F1 opens a Help Window, F11 toggles between FullScreen and normal windowed mode. All is developed using Oxygen and Winapi, no external libraries.

There are some issues. But as we expect some visits this afternoon, I can not address these problems until tomorrow.

Roland

Edit: I forgot about Ctrl-R. This will reset the Image to the original state. Replaced Tut08.o2bas with the adjusted Help Dialog

[attachment deleted by admin]
« Last Edit: March 31, 2018, 11:49:30 AM by Arnold »

Arnold

  • Guest
Re: Nehe tutorial in a dynamic dialog
« Reply #1 on: February 26, 2018, 12:37:45 AM »
Hi Charles,

in order to use imgwin.inc for Nehe lesson 08 I had to use #case capital. I did not give much attention to this directive before but it is a powerful possibility to prevent ambiguities yet it also requires some discipline which I did not notice before.

Perhaps you could change in Dialogs.inc line 308 the naming of the sub to:
sub Control( string ....

Then there would be no need for: #def Control CONTROL in such cases. Exact naming would be required nevertheless, but this is ok.

The same problem occurs with OPENFILENAMEA in FileDialog.inc. If the types were written lowercase then there would be no need e.g.:
typedef sys SYS
typedef char CHAR
but I do not know if there was a special intention for using uppercase for this structure in FileDialog.inc

There is also an error message when using console.inc with #case capital:
ASM ERR: coord_op(..)!! Unidentified instruction: coord_op, line 131

If I comment out line 131:
'  dwConSize = csbi.dwSize.X * csbi.dwSize.Y;

I can use console.inc with Tut08.o2bas or other projects which add #case capital, but I assume there is an intention for this line? I do not understand why the COORD type is not recognized in this case.

With the latest release of OxygenBasic (Feb. 24) you changed something with using structures? Prior to this version I could use:

   ACCEL accl[13] = {
'   {asc("O"),      IDM_Load,       FVIRTKEY | FCONTROL},

Now I have to use:
    {79,      IDM_Load,             FVIRTKEY | FCONTROL},

Did this change happen intentionally?

Roland
 

Charles Pegge

  • Guest
Re: Nehe tutorial in a dynamic dialog
« Reply #2 on: February 26, 2018, 08:43:34 AM »
Hi Roland,

The capital X and Y in coord (console.inc) was causing problems for coordderived types

I have also found the asc("O") problem in the multiassign block, and will update oxygen.dll shortly.

Arnold

  • Guest
Re: Nehe tutorial in a dynamic dialog
« Reply #3 on: February 27, 2018, 03:46:13 AM »
Hi Charles,

may I ask you for some details about the structure of the program? I tried to code the subs similar to the original Nehe08.cpp, but using routines of glWinUtil, WinUtil and ImgWin. Now I am not sure if I did this correctly. My questions would be:
did I use glGentTextures / glDeleteTextures correctly?
Gdiplustoken, Gdiplus 0, Gdiplus 1: are there better ways to set these items?
SelectPixelFormat(hDlgHDC, 1) : This is only trial and error. Is this correct? What is the effect of 0, >0?
sub LoadGLTextures: This is also only experimenting. Would I need to load the image 3 times and use three wi[], ht[]?

Although I do not see a difference with the original program I wonder about the purpose of "Filter". I cannot see a different effect if I press 'F'.

Hopefully you will find some time to look at the code. I would like to use as much as possible of the Oxygenbasic library routines, though OpenglSceneFrame.inc is a bit too difficult for me at the moment.

Roland

Charles Pegge

  • Guest
Re: Nehe tutorial in a dynamic dialog
« Reply #4 on: February 27, 2018, 12:54:18 PM »
Hi Roland,

Your program looks pretty good to me, though I will have to walk through it to see if there are any problems managing textures etc. Would it be okay to add this to our example collection?

There is an example which may help demonstrate OpenglSceneFrame with popup menus:

examples/Opengl/MenuObj.o2bas

I use OSF with nearly all theOpengl demos. It is an aggregation  of many Nehe lessons, and performs well as base code, leaving you to deal with geometry, textures and animation. But I expect most developers will have their own fully customised 3d engines, honed to perfection.

Arnold

  • Guest
Re: Nehe tutorial in a dynamic dialog
« Reply #5 on: February 28, 2018, 04:31:32 AM »
Hi Charles,

thank you for pointing me to MenuObj.o2bas. It will take some time until I understand everything. I suppose it is too late for me to become an OpenGL expert, but I want to catch at least the basics.

Roland

Arnold

  • Guest
Re: Nehe tutorial in a dynamic dialog
« Reply #6 on: March 31, 2018, 11:55:42 AM »
Hi Charles,

I modified Nehe's lesson8 example a little bit for the latest OxygenBasicProgress installation and named it NeheTut08.o2bas. It can be run in JIT mode, and it can be compiled as a 32-bit or 64-bit executable. F1 for Help can always be called. I think the app is more user-friendly and it runs better in some cases e.g. changing to fullscreen / normal mode. Some activities are added e.g. Page up/down in reset mode.

I am still not sure if I used correctly glGenTextures in line 77 and glDeleteTextures in line 258. I am also insecure about sub LoadGLTextures, where I used 1 imgs instead of 3. IDM_FILTER in line 191 should change a filter, yet I do not see any effect with this feature. But I do not see an effect using the original program neither. Nethertheless I am quite happy with the app.

Quote
Would it be okay to add this to our example collection?

If there is / will be anything from me - unmodified or modified - which you consider to be usable, it will be an honor for me. I learned so much from you in the meantime, and if it is possible I would like to reciprocate.

Roland

Arnold

  • Guest
Re: Nehe tutorial in a dynamic dialog
« Reply #7 on: March 31, 2018, 12:17:21 PM »
Attached are the exe files for 32-bit and 64-bit

Edit: Deleted. Looking for a better solution.

« Last Edit: April 03, 2018, 01:51:27 PM by Arnold »

chrisc

  • Guest
Re: Nehe tutorial in a dynamic dialog
« Reply #8 on: March 31, 2018, 01:11:37 PM »
@Roland

My Mcafee AV detected the exe.zip file as virus "machine learning " !

Arnold

  • Guest
Re: Nehe tutorial in a dynamic dialog
« Reply #9 on: March 31, 2018, 01:25:42 PM »
Hi Chris,

I checked the files at www.virustotal.com before I uploaded them. These are the results:

NeheTut08_64.exe: 0 / 64
NeheTut08_32.exe: 3 / 66 - Avira, Bkav, Cylance
NeheTut08_exes.zip: 3 / 66 - Avira, Bkav, Cylance

McAfee did not give a warning. Is your version up-to-date?

Roland

chrisc

  • Guest
Re: Nehe tutorial in a dynamic dialog
« Reply #10 on: April 01, 2018, 08:10:47 AM »
@Roland

never mind, the entire zip was capture and quarantin by Mcafee  AV.  but i was able to compile your o2bas file
and able to show the rotating images.  It is very good

Thanxx a lot



JRS

  • Guest
Re: Nehe tutorial in a dynamic dialog
« Reply #11 on: April 01, 2018, 09:58:49 AM »
I highly recommend that members of the forum not upload .EXE files. Let the members of the forum compile the O2 source.

Arnold

  • Guest
Re: Nehe tutorial in a dynamic dialog
« Reply #12 on: April 01, 2018, 11:11:57 AM »
Maybe it is simpler to avoid uploading. But how will this help to minimize the problem of false postive notifications?

JRS

  • Guest
Re: Nehe tutorial in a dynamic dialog
« Reply #13 on: April 01, 2018, 12:50:47 PM »
It seems like such a waste of Charles's time chasing down false positives. Maybe we need someone other than Charles to take on the task?






chrisc

  • Guest
Re: Nehe tutorial in a dynamic dialog
« Reply #14 on: April 01, 2018, 01:03:40 PM »

Hello

i believe that the new AV uses Artificial Intelligence to check on unknown executables and their
behavior against their own benchmark,  if they found that the exe files behave differently and
it is unknown to them (not on their blacklists or white lists) they simply quarantine these files.
And let the user decides whether to erase them or not.

i find that AV now mainly capture unknown exe or dll mainly of the 32bit ones.

now i have to place in scan exclusions for Oxygen basic folders so that it won't capture any of my exe files