WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
Pages (3) 1 [2] 3   ( Go to first unread post )

C++ OpenGl tutorial translated to Assembly, the prototypes from masm32 includes conflict with the ones in C++ and my program runs but it crashes on CreateWindowEx.

Savage
Quote Post


Very Very Active Member
*****

Group: Members
Posts: 88
Member No.: 1048
Joined: 27-February 05


actually I just found some examples, that work.

Unfortunately I can't exactly find what's wrong with my code =/
PMEmail PosterUsers Website
Top
Phoenix
Quote Post


Active Member
***

Group: Members
Posts: 43
Member No.: 852
Joined: 12-December 04


CreateWindowEx returns: ERROR_INVALID_WINDOW_HANDLE (1400), but i cannot see why...
PMEmail Poster
Top
Savage
Quote Post


Very Very Active Member
*****

Group: Members
Posts: 88
Member No.: 1048
Joined: 27-February 05


Good news: Finally got it working.


Bad news: It's ugly. I'm gonna try to clean it up and then I"ll show my results.

PMEmail PosterUsers Website
Top
Savage
Quote Post


Very Very Active Member
*****

Group: Members
Posts: 88
Member No.: 1048
Joined: 27-February 05


Finally got this thing to work, but I finally just had to format the openGL functions to how they really should be defined.


This is just a template for OpenGL programs.
Press escape to quit, or F1 to toggle fullscreen mode.

Attached File ( Number of downloads: 33 )
 Login or Register to download
PMEmail PosterUsers Website
Top
icehole
Quote Post


Extremely Active Member
******

Group: Members
Posts: 168
Member No.: 1938
Joined: 12-January 06


QUOTE (Savage @ May 28 2006, 10:22 PM)
2) Masm's faulty prototypes.  Instead of using the "REAL8" data type, it will simply use two "DWORD"s in a row, so that it takes up the same amount of space.  Why did they do this?

QUOTE (Savage @ May 29 2006, 02:03 PM)
Good news: Finally got it working.


Bad news: It's ugly.  I'm gonna try to clean it up and then I"ll show my results.

You want to talk ugly:

Here is just one of the faulty protos you referred to followed by some code to call the function (written in ASM) i found:

gluPerspective PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD

push _100d0
push _100d1
push _01d0
push _01d1
push dword ptr [_aspd+4]
push dword ptr [_aspd]
push _45d0
push _45d1
call gluPerspective


Compare that to your fixed up proto and your invoke:

gluPerspective PROTO :REAL8, :REAL8, :REAL8, :REAL8

invoke gluPerspective,$dConst(45.0),dRatio,$dConst(0.1),$dConst(100.0)

which lays down nicely with the function definition from MSDN:
void gluPerspective(
GLdouble fovy,
GLdouble aspect,
GLdouble zNear,
GLdouble zFar
);

And that is just one example.
I don't know how anyone could work with the masm32 GL includes that way.

Savage, your Xopengl32.inc is destined to be in every household. Keep up the good work smile.gif

edit~
I see you cleaned it up some
GLprotos.inc it is then - hehe wink.gif
Nice grunt work.
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Pages (3) 1 [2] 3  Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google