diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu1.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu1.asm index 85b45894c3..5657abf139 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu1.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu1.asm @@ -1,5 +1,5 @@ use32 - org 0x0 + org 0 db 'MENUET01' dd 1,start,i_end,mem,stacktop,0,cur_dir_path @@ -8,6 +8,7 @@ include '../../../../../macros.inc' include '../../../../../KOSfuncs.inc' include '../../../../../load_img.inc' include '../opengl_const.inc' +include '../zbuffer.inc' include '../../../../../develop/info3ds/info_fun_float.inc' @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load @@ -16,7 +17,11 @@ align 4 image_data_toolbar dd 0 IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3 -offs_zbuf_pbuf equ 24 ;const. from 'zbuffer.inc' +;Макрос для параметров типа double (8 байт) +macro glpush GLDoubleVar { + push dword[GLDoubleVar+4] + push dword[GLDoubleVar] +} align 4 start: @@ -38,7 +43,7 @@ load_libraries l_libs_start,l_libs_end stdcall [kosglMakeCurrent], 5,30,[buf_ogl.w],[buf_ogl.h],ctx1 stdcall [glEnable], GL_DEPTH_TEST stdcall [glEnable], GL_NORMALIZE ;делам нормали одинаковой величины во избежание артефактов - stdcall [gluNewQuadric] + call [gluNewQuadric] mov [qObj],eax stdcall [glClearColor], 0.25,0.25,0.25,0.0 @@ -46,7 +51,7 @@ load_libraries l_libs_start,l_libs_end mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext mov eax,[eax] ;eax -> ZBuffer - mov eax,[eax+offs_zbuf_pbuf] ;eax -> ZBuffer.pbuf + mov eax,[eax+ZBuffer.pbuf] mov dword[buf_ogl],eax load_image_file 'font8x9.bmp', image_data_toolbar, buf_1.w,buf_1.h @@ -96,7 +101,7 @@ draw_window: add ebx,IMAGE_TOOLBAR_ICON_SIZE mcall ,,,(125 shl 16)+5 ;масштаб - - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] mcall SF_REDRAW,SSF_END_DRAW popad ret @@ -130,7 +135,8 @@ key: mov byte[txt_angle_y.v],0 stdcall str_cat, txt_angle_y.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] + jmp still @@: cmp ah,177 ;Down jne @f @@ -144,7 +150,8 @@ key: mov byte[txt_angle_y.v],0 stdcall str_cat, txt_angle_y.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] + jmp still @@: cmp ah,176 ;Left jne @f @@ -158,7 +165,8 @@ key: mov byte[txt_angle_z.v],0 stdcall str_cat, txt_angle_z.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] + jmp still @@: cmp ah,179 ;Right jne @f @@ -172,7 +180,8 @@ key: mov byte[txt_angle_z.v],0 stdcall str_cat, txt_angle_z.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] + ;jmp still @@: jmp still @@ -216,21 +225,21 @@ align 4 but_st_point: stdcall [gluQuadricDrawStyle], [qObj],GLU_POINT call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] ret align 4 but_st_line: stdcall [gluQuadricDrawStyle], [qObj],GLU_LINE call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] ret align 4 but_st_face: stdcall [gluQuadricDrawStyle], [qObj],GLU_FILL call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] ret align 4 @@ -253,7 +262,7 @@ but_zoom_p: mov byte[txt_scale.v],0 stdcall str_cat, txt_scale.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] ret align 4 @@ -276,16 +285,14 @@ but_zoom_m: mov byte[txt_scale.v],0 stdcall str_cat, txt_scale.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] ret align 4 caption db 'Test gluCylinder, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0 -align 4 -ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext -;sizeof.TinyGLContext = 28 +align 4 rad1 dq 1.0 rad2 dq 0.55 rad3 dq 0.15 @@ -296,7 +303,7 @@ align 4 draw_3d: stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины -stdcall [glPushMatrix] +call [glPushMatrix] call SetLight stdcall [glTranslatef], 0.0,0.0,0.5 @@ -316,7 +323,7 @@ stdcall [glPushMatrix] stdcall [glColor3f], 0.0, 0.0, 1.0 stdcall [glTranslatef], 3.2,0.0,0.0 stdcall [gluCylinder], [qObj], rad2,rad3,hei2, 16,8 -stdcall [glPopMatrix] +call [glPopMatrix] stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_scale,5,5,0xffff00 stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_angle_z,5,15,0xffff00 @@ -341,8 +348,6 @@ SetLight: stdcall [glEnable],GL_LIGHT0 ret -qObj dd 0 - scale dd 0.4 ;начальный масштаб sc_delt dd 0.05 ;изменение масштаба при нажатии sc_min dd 0.1 ;минимальный масштаб @@ -432,49 +437,51 @@ import_buf2d: align 4 import_libimg: dd alib_init1 - img_is_img dd aimg_is_img - img_info dd aimg_info - img_from_file dd aimg_from_file - img_to_file dd aimg_to_file - img_from_rgb dd aimg_from_rgb - img_to_rgb dd aimg_to_rgb +; img_is_img dd aimg_is_img +; img_info dd aimg_info +; img_from_file dd aimg_from_file +; img_to_file dd aimg_to_file +; img_from_rgb dd aimg_from_rgb +; img_to_rgb dd aimg_to_rgb img_to_rgb2 dd aimg_to_rgb2 img_decode dd aimg_decode - img_encode dd aimg_encode - img_create dd aimg_create +; img_encode dd aimg_encode +; img_create dd aimg_create img_destroy dd aimg_destroy - img_destroy_layer dd aimg_destroy_layer - img_count dd aimg_count - img_lock_bits dd aimg_lock_bits - img_unlock_bits dd aimg_unlock_bits - img_flip dd aimg_flip - img_flip_layer dd aimg_flip_layer - img_rotate dd aimg_rotate - img_rotate_layer dd aimg_rotate_layer - img_draw dd aimg_draw +; img_destroy_layer dd aimg_destroy_layer +; img_count dd aimg_count +; img_lock_bits dd aimg_lock_bits +; img_unlock_bits dd aimg_unlock_bits +; img_flip dd aimg_flip +; img_flip_layer dd aimg_flip_layer +; img_rotate dd aimg_rotate +; img_rotate_layer dd aimg_rotate_layer +; img_draw dd aimg_draw +; img_convert dd aimg_convert dd 0,0 alib_init1 db 'lib_init',0 - aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение - aimg_info db 'img_info',0 - aimg_from_file db 'img_from_file',0 - aimg_to_file db 'img_to_file',0 - aimg_from_rgb db 'img_from_rgb',0 - aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB +; aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение +; aimg_info db 'img_info',0 +; aimg_from_file db 'img_from_file',0 +; aimg_to_file db 'img_to_file',0 +; aimg_from_rgb db 'img_from_rgb',0 +; aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB aimg_to_rgb2 db 'img_to_rgb2',0 aimg_decode db 'img_decode',0 ;автоматически определяет формат графических данных - aimg_encode db 'img_encode',0 - aimg_create db 'img_create',0 +; aimg_encode db 'img_encode',0 +; aimg_create db 'img_create',0 aimg_destroy db 'img_destroy',0 - aimg_destroy_layer db 'img_destroy_layer',0 - aimg_count db 'img_count',0 - aimg_lock_bits db 'img_lock_bits',0 - aimg_unlock_bits db 'img_unlock_bits',0 - aimg_flip db 'img_flip',0 - aimg_flip_layer db 'img_flip_layer',0 - aimg_rotate db 'img_rotate',0 - aimg_rotate_layer db 'img_rotate_layer',0 - aimg_draw db 'img_draw',0 +; aimg_destroy_layer db 'img_destroy_layer',0 +; aimg_count db 'img_count',0 +; aimg_lock_bits db 'img_lock_bits',0 +; aimg_unlock_bits db 'img_unlock_bits',0 +; aimg_flip db 'img_flip',0 +; aimg_flip_layer db 'img_flip_layer',0 +; aimg_rotate db 'img_rotate',0 +; aimg_rotate_layer db 'img_rotate_layer',0 +; aimg_draw db 'img_draw',0 +; aimg_convert db 'img_convert',0 ;-------------------------------------------------- system_dir_0 db '/sys/lib/' @@ -483,14 +490,14 @@ system_dir_1 db '/sys/lib/' lib_name_1 db 'buf2d.obj',0 system_dir_2 db '/sys/lib/' lib_name_2 db 'libimg.obj',0 -err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,0 -err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,0 -err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,0 +err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0 +err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,'" -tE',0 +err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,'" -tE',0 head_f_i: -head_f_l db 'System error',0 -err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,0 -err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,0 -err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,0 +head_f_l db '"System error',0 +err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0 +err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,'" -tE',0 +err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,'" -tE',0 ;-------------------------------------------------- txt_scale: @@ -538,6 +545,8 @@ l_libs_end: align 4 i_end: + ctx1 rb 28 ;sizeof.TinyGLContext = 28 + qObj dd 0 run_file_70 FileInfoBlock sc system_colors align 16 diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu2.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu2.asm index 061a1b0607..a5eb9a1ccc 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu2.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu2.asm @@ -1,5 +1,5 @@ use32 - org 0x0 + org 0 db 'MENUET01' dd 1,start,i_end,mem,stacktop,0,cur_dir_path @@ -8,6 +8,7 @@ include '../../../../../macros.inc' include '../../../../../KOSfuncs.inc' include '../../../../../load_img.inc' include '../opengl_const.inc' +include '../zbuffer.inc' include '../../../../../develop/info3ds/info_fun_float.inc' @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load @@ -16,7 +17,11 @@ align 4 image_data_toolbar dd 0 IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3 -offs_zbuf_pbuf equ 24 ;const. from 'zbuffer.inc' +;Макрос для параметров типа double (8 байт) +macro glpush GLDoubleVar { + push dword[GLDoubleVar+4] + push dword[GLDoubleVar] +} align 4 start: @@ -38,7 +43,7 @@ load_libraries l_libs_start,l_libs_end stdcall [kosglMakeCurrent], 5,30,[buf_ogl.w],[buf_ogl.h],ctx1 stdcall [glEnable], GL_DEPTH_TEST stdcall [glEnable], GL_NORMALIZE ;делам нормали одинаковой величины во избежание артефактов - stdcall [gluNewQuadric] + call [gluNewQuadric] mov [qObj],eax stdcall [glClearColor], 0.25,0.25,0.25,0.0 @@ -46,7 +51,7 @@ load_libraries l_libs_start,l_libs_end mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext mov eax,[eax] ;eax -> ZBuffer - mov eax,[eax+offs_zbuf_pbuf] ;eax -> ZBuffer.pbuf + mov eax,[eax+ZBuffer.pbuf] mov dword[buf_ogl],eax load_image_file 'font8x9.bmp', image_data_toolbar, buf_1.w,buf_1.h @@ -96,7 +101,7 @@ draw_window: add ebx,IMAGE_TOOLBAR_ICON_SIZE mcall ,,,(125 shl 16)+5 ;масштаб - - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] mcall SF_REDRAW,SSF_END_DRAW popad ret @@ -130,7 +135,8 @@ key: mov byte[txt_angle_y.v],0 stdcall str_cat, txt_angle_y.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] + jmp still @@: cmp ah,177 ;Down jne @f @@ -144,7 +150,8 @@ key: mov byte[txt_angle_y.v],0 stdcall str_cat, txt_angle_y.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] + jmp still @@: cmp ah,176 ;Left jne @f @@ -158,7 +165,8 @@ key: mov byte[txt_angle_z.v],0 stdcall str_cat, txt_angle_z.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] + jmp still @@: cmp ah,179 ;Right jne @f @@ -172,7 +180,8 @@ key: mov byte[txt_angle_z.v],0 stdcall str_cat, txt_angle_z.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] + ;jmp still @@: jmp still @@ -216,21 +225,21 @@ align 4 but_st_point: stdcall [gluQuadricDrawStyle], [qObj],GLU_POINT call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] ret align 4 but_st_line: stdcall [gluQuadricDrawStyle], [qObj],GLU_LINE call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] ret align 4 but_st_face: stdcall [gluQuadricDrawStyle], [qObj],GLU_FILL call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] ret align 4 @@ -253,7 +262,7 @@ but_zoom_p: mov byte[txt_scale.v],0 stdcall str_cat, txt_scale.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] ret align 4 @@ -276,21 +285,18 @@ but_zoom_m: mov byte[txt_scale.v],0 stdcall str_cat, txt_scale.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] ret align 4 caption db 'Test gluSphere, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0 -align 4 -ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext -;sizeof.TinyGLContext = 28 align 4 draw_3d: stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины -stdcall [glPushMatrix] +call [glPushMatrix] call SetLight stdcall [glTranslatef], 0.0,0.0,0.5 @@ -308,7 +314,7 @@ stdcall [glPushMatrix] stdcall [glColor3f], 0.0, 0.0, 1.0 stdcall [glTranslatef], 3.2,0.0,0.0 stdcall [gluSphere], [qObj], 0.55, 16,16 -stdcall [glPopMatrix] +call [glPopMatrix] stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_scale,5,5,0xffff00 stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_angle_z,5,15,0xffff00 @@ -333,8 +339,6 @@ SetLight: stdcall [glEnable],GL_LIGHT0 ret -qObj dd 0 - scale dd 0.4 ;начальный масштаб sc_delt dd 0.05 ;изменение масштаба при нажатии sc_min dd 0.1 ;минимальный масштаб @@ -424,49 +428,51 @@ import_buf2d: align 4 import_libimg: dd alib_init1 - img_is_img dd aimg_is_img - img_info dd aimg_info - img_from_file dd aimg_from_file - img_to_file dd aimg_to_file - img_from_rgb dd aimg_from_rgb - img_to_rgb dd aimg_to_rgb +; img_is_img dd aimg_is_img +; img_info dd aimg_info +; img_from_file dd aimg_from_file +; img_to_file dd aimg_to_file +; img_from_rgb dd aimg_from_rgb +; img_to_rgb dd aimg_to_rgb img_to_rgb2 dd aimg_to_rgb2 img_decode dd aimg_decode - img_encode dd aimg_encode - img_create dd aimg_create +; img_encode dd aimg_encode +; img_create dd aimg_create img_destroy dd aimg_destroy - img_destroy_layer dd aimg_destroy_layer - img_count dd aimg_count - img_lock_bits dd aimg_lock_bits - img_unlock_bits dd aimg_unlock_bits - img_flip dd aimg_flip - img_flip_layer dd aimg_flip_layer - img_rotate dd aimg_rotate - img_rotate_layer dd aimg_rotate_layer - img_draw dd aimg_draw +; img_destroy_layer dd aimg_destroy_layer +; img_count dd aimg_count +; img_lock_bits dd aimg_lock_bits +; img_unlock_bits dd aimg_unlock_bits +; img_flip dd aimg_flip +; img_flip_layer dd aimg_flip_layer +; img_rotate dd aimg_rotate +; img_rotate_layer dd aimg_rotate_layer +; img_draw dd aimg_draw +; img_convert dd aimg_convert dd 0,0 alib_init1 db 'lib_init',0 - aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение - aimg_info db 'img_info',0 - aimg_from_file db 'img_from_file',0 - aimg_to_file db 'img_to_file',0 - aimg_from_rgb db 'img_from_rgb',0 - aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB +; aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение +; aimg_info db 'img_info',0 +; aimg_from_file db 'img_from_file',0 +; aimg_to_file db 'img_to_file',0 +; aimg_from_rgb db 'img_from_rgb',0 +; aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB aimg_to_rgb2 db 'img_to_rgb2',0 aimg_decode db 'img_decode',0 ;автоматически определяет формат графических данных - aimg_encode db 'img_encode',0 - aimg_create db 'img_create',0 +; aimg_encode db 'img_encode',0 +; aimg_create db 'img_create',0 aimg_destroy db 'img_destroy',0 - aimg_destroy_layer db 'img_destroy_layer',0 - aimg_count db 'img_count',0 - aimg_lock_bits db 'img_lock_bits',0 - aimg_unlock_bits db 'img_unlock_bits',0 - aimg_flip db 'img_flip',0 - aimg_flip_layer db 'img_flip_layer',0 - aimg_rotate db 'img_rotate',0 - aimg_rotate_layer db 'img_rotate_layer',0 - aimg_draw db 'img_draw',0 +; aimg_destroy_layer db 'img_destroy_layer',0 +; aimg_count db 'img_count',0 +; aimg_lock_bits db 'img_lock_bits',0 +; aimg_unlock_bits db 'img_unlock_bits',0 +; aimg_flip db 'img_flip',0 +; aimg_flip_layer db 'img_flip_layer',0 +; aimg_rotate db 'img_rotate',0 +; aimg_rotate_layer db 'img_rotate_layer',0 +; aimg_draw db 'img_draw',0 +; aimg_convert db 'img_convert',0 ;-------------------------------------------------- system_dir_0 db '/sys/lib/' @@ -475,14 +481,14 @@ system_dir_1 db '/sys/lib/' lib_name_1 db 'buf2d.obj',0 system_dir_2 db '/sys/lib/' lib_name_2 db 'libimg.obj',0 -err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,0 -err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,0 -err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,0 +err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0 +err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,'" -tE',0 +err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,'" -tE',0 head_f_i: -head_f_l db 'System error',0 -err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,0 -err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,0 -err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,0 +head_f_l db '"System error',0 +err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0 +err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,'" -tE',0 +err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,'" -tE',0 ;-------------------------------------------------- txt_scale: @@ -530,6 +536,8 @@ l_libs_end: align 4 i_end: + ctx1 rb 28 ;sizeof.TinyGLContext = 28 + qObj dd 0 run_file_70 FileInfoBlock sc system_colors align 16 diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/textures0.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/textures0.asm index 96df0441f8..fef6d77bdf 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/textures0.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/textures0.asm @@ -8,16 +8,21 @@ include '../../../../../macros.inc' include '../../../../../KOSfuncs.inc' include '../../../../../load_img.inc' include '../opengl_const.inc' +include '../zbuffer.inc' include '../../../../../develop/info3ds/info_fun_float.inc' @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load +;Макрос для параметров типа double (8 байт) +macro glpush GLDoubleVar { + push dword[GLDoubleVar+4] + push dword[GLDoubleVar] +} + align 4 image_data_toolbar dd 0 IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3 -offs_zbuf_pbuf equ 24 ;const. from 'zbuffer.inc' - align 4 start: load_libraries l_libs_start,l_libs_end @@ -38,7 +43,7 @@ load_libraries l_libs_start,l_libs_end stdcall [kosglMakeCurrent], 5,30,[buf_ogl.w],[buf_ogl.h],ctx1 stdcall [glEnable], GL_DEPTH_TEST stdcall [glEnable], GL_NORMALIZE ;делам нормали одинаковой величины во избежание артефактов - stdcall [gluNewQuadric] + call [gluNewQuadric] mov [qObj],eax stdcall [gluQuadricTexture], eax,GL_TRUE @@ -47,7 +52,7 @@ load_libraries l_libs_start,l_libs_end mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext mov eax,[eax] ;eax -> ZBuffer - mov eax,[eax+offs_zbuf_pbuf] ;eax -> ZBuffer.pbuf + mov eax,[eax+ZBuffer.pbuf] mov dword[buf_ogl],eax load_image_file 'font8x9.bmp', image_data_toolbar, buf_1.w,buf_1.h @@ -290,7 +295,7 @@ align 4 draw_3d: stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины -stdcall [glPushMatrix] +call [glPushMatrix] stdcall [glTranslatef], 0.0,0.0,0.5 stdcall [glScalef], [scale], [scale], [scale] stdcall [glRotatef], [angle_z],0.0,0.0,1.0 @@ -375,9 +380,9 @@ jne @f stdcall [glTexCoord2f], 0.0f, 1.0f stdcall [glVertex3f], -1.0f, 1.0f, -1.0f ; Верх лево - stdcall [glEnd] + call [glEnd] @@: -stdcall [glPopMatrix] +call [glPopMatrix] stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_scale,5,5,0xffff00 stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_angle_z,5,15,0xffff00 @@ -473,49 +478,51 @@ import_buf2d: align 4 import_libimg: dd alib_init1 - img_is_img dd aimg_is_img - img_info dd aimg_info - img_from_file dd aimg_from_file - img_to_file dd aimg_to_file - img_from_rgb dd aimg_from_rgb - img_to_rgb dd aimg_to_rgb +; img_is_img dd aimg_is_img +; img_info dd aimg_info +; img_from_file dd aimg_from_file +; img_to_file dd aimg_to_file +; img_from_rgb dd aimg_from_rgb +; img_to_rgb dd aimg_to_rgb img_to_rgb2 dd aimg_to_rgb2 img_decode dd aimg_decode - img_encode dd aimg_encode - img_create dd aimg_create +; img_encode dd aimg_encode +; img_create dd aimg_create img_destroy dd aimg_destroy - img_destroy_layer dd aimg_destroy_layer - img_count dd aimg_count - img_lock_bits dd aimg_lock_bits - img_unlock_bits dd aimg_unlock_bits - img_flip dd aimg_flip - img_flip_layer dd aimg_flip_layer - img_rotate dd aimg_rotate - img_rotate_layer dd aimg_rotate_layer - img_draw dd aimg_draw +; img_destroy_layer dd aimg_destroy_layer +; img_count dd aimg_count +; img_lock_bits dd aimg_lock_bits +; img_unlock_bits dd aimg_unlock_bits +; img_flip dd aimg_flip +; img_flip_layer dd aimg_flip_layer +; img_rotate dd aimg_rotate +; img_rotate_layer dd aimg_rotate_layer +; img_draw dd aimg_draw +; img_convert dd aimg_convert dd 0,0 alib_init1 db 'lib_init',0 - aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение - aimg_info db 'img_info',0 - aimg_from_file db 'img_from_file',0 - aimg_to_file db 'img_to_file',0 - aimg_from_rgb db 'img_from_rgb',0 - aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB +; aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение +; aimg_info db 'img_info',0 +; aimg_from_file db 'img_from_file',0 +; aimg_to_file db 'img_to_file',0 +; aimg_from_rgb db 'img_from_rgb',0 +; aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB aimg_to_rgb2 db 'img_to_rgb2',0 aimg_decode db 'img_decode',0 ;автоматически определяет формат графических данных - aimg_encode db 'img_encode',0 - aimg_create db 'img_create',0 +; aimg_encode db 'img_encode',0 +; aimg_create db 'img_create',0 aimg_destroy db 'img_destroy',0 - aimg_destroy_layer db 'img_destroy_layer',0 - aimg_count db 'img_count',0 - aimg_lock_bits db 'img_lock_bits',0 - aimg_unlock_bits db 'img_unlock_bits',0 - aimg_flip db 'img_flip',0 - aimg_flip_layer db 'img_flip_layer',0 - aimg_rotate db 'img_rotate',0 - aimg_rotate_layer db 'img_rotate_layer',0 - aimg_draw db 'img_draw',0 +; aimg_destroy_layer db 'img_destroy_layer',0 +; aimg_count db 'img_count',0 +; aimg_lock_bits db 'img_lock_bits',0 +; aimg_unlock_bits db 'img_unlock_bits',0 +; aimg_flip db 'img_flip',0 +; aimg_flip_layer db 'img_flip_layer',0 +; aimg_rotate db 'img_rotate',0 +; aimg_rotate_layer db 'img_rotate_layer',0 +; aimg_draw db 'img_draw',0 +; aimg_convert db 'img_convert',0 ;-------------------------------------------------- system_dir_0 db '/sys/lib/' @@ -579,8 +586,7 @@ l_libs_end: align 4 i_end: - ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext - ;sizeof.TinyGLContext = 28 + ctx1 rb 28 ;sizeof.TinyGLContext = 28 dr_figure dd 0 qObj dd 0 TexObj dd 0 ;массив указателей на текстуры (в данном случае 1 шт.) diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/textures1.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/textures1.asm index ed111fe428..035b88f7de 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/textures1.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/textures1.asm @@ -8,16 +8,21 @@ include '../../../../../macros.inc' include '../../../../../KOSfuncs.inc' include '../../../../../load_img.inc' include '../opengl_const.inc' +include '../zbuffer.inc' include '../../../../../develop/info3ds/info_fun_float.inc' @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load +;Макрос для параметров типа double (8 байт) +macro glpush GLDoubleVar { + push dword[GLDoubleVar+4] + push dword[GLDoubleVar] +} + align 4 image_data_toolbar dd 0 IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3 -offs_zbuf_pbuf equ 24 ;const. from 'zbuffer.inc' - align 4 start: load_libraries l_libs_start,l_libs_end @@ -38,7 +43,7 @@ load_libraries l_libs_start,l_libs_end stdcall [kosglMakeCurrent], 5,30,[buf_ogl.w],[buf_ogl.h],ctx1 stdcall [glEnable], GL_DEPTH_TEST stdcall [glEnable], GL_NORMALIZE ;делам нормали одинаковой величины во избежание артефактов - stdcall [gluNewQuadric] + call [gluNewQuadric] mov [qObj],eax stdcall [gluQuadricTexture], eax,GL_TRUE @@ -47,7 +52,7 @@ load_libraries l_libs_start,l_libs_end mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext mov eax,[eax] ;eax -> ZBuffer - mov eax,[eax+offs_zbuf_pbuf] ;eax -> ZBuffer.pbuf + mov eax,[eax+ZBuffer.pbuf] mov dword[buf_ogl],eax load_image_file 'font8x9.bmp', image_data_toolbar, buf_1.w,buf_1.h @@ -292,7 +297,7 @@ align 4 draw_3d: stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины -stdcall [glPushMatrix] +call [glPushMatrix] stdcall [glTranslatef], 0.0,0.0,0.5 stdcall [glScalef], [scale], [scale], [scale] stdcall [glScalef], 1.0, 1.0, 0.1 ;прижимаем сферу, что-бы сразу не вылазила при увеличении @@ -314,7 +319,7 @@ jne @f stdcall [gluQuadricDrawStyle], [qObj],GLU_FILL stdcall [gluSphere], [qObj], 1.0, 64,64 @@: -stdcall [glPopMatrix] +call [glPopMatrix] stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_scale,5,5,0xffff00 stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_angle_y,5,15,0xffff00 @@ -403,49 +408,51 @@ import_buf2d: align 4 import_libimg: dd alib_init1 - img_is_img dd aimg_is_img - img_info dd aimg_info - img_from_file dd aimg_from_file - img_to_file dd aimg_to_file - img_from_rgb dd aimg_from_rgb - img_to_rgb dd aimg_to_rgb +; img_is_img dd aimg_is_img +; img_info dd aimg_info +; img_from_file dd aimg_from_file +; img_to_file dd aimg_to_file +; img_from_rgb dd aimg_from_rgb +; img_to_rgb dd aimg_to_rgb img_to_rgb2 dd aimg_to_rgb2 img_decode dd aimg_decode - img_encode dd aimg_encode - img_create dd aimg_create +; img_encode dd aimg_encode +; img_create dd aimg_create img_destroy dd aimg_destroy - img_destroy_layer dd aimg_destroy_layer - img_count dd aimg_count - img_lock_bits dd aimg_lock_bits - img_unlock_bits dd aimg_unlock_bits - img_flip dd aimg_flip - img_flip_layer dd aimg_flip_layer - img_rotate dd aimg_rotate - img_rotate_layer dd aimg_rotate_layer - img_draw dd aimg_draw +; img_destroy_layer dd aimg_destroy_layer +; img_count dd aimg_count +; img_lock_bits dd aimg_lock_bits +; img_unlock_bits dd aimg_unlock_bits +; img_flip dd aimg_flip +; img_flip_layer dd aimg_flip_layer +; img_rotate dd aimg_rotate +; img_rotate_layer dd aimg_rotate_layer +; img_draw dd aimg_draw +; img_convert dd aimg_convert dd 0,0 alib_init1 db 'lib_init',0 - aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение - aimg_info db 'img_info',0 - aimg_from_file db 'img_from_file',0 - aimg_to_file db 'img_to_file',0 - aimg_from_rgb db 'img_from_rgb',0 - aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB +; aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение +; aimg_info db 'img_info',0 +; aimg_from_file db 'img_from_file',0 +; aimg_to_file db 'img_to_file',0 +; aimg_from_rgb db 'img_from_rgb',0 +; aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB aimg_to_rgb2 db 'img_to_rgb2',0 aimg_decode db 'img_decode',0 ;автоматически определяет формат графических данных - aimg_encode db 'img_encode',0 - aimg_create db 'img_create',0 +; aimg_encode db 'img_encode',0 +; aimg_create db 'img_create',0 aimg_destroy db 'img_destroy',0 - aimg_destroy_layer db 'img_destroy_layer',0 - aimg_count db 'img_count',0 - aimg_lock_bits db 'img_lock_bits',0 - aimg_unlock_bits db 'img_unlock_bits',0 - aimg_flip db 'img_flip',0 - aimg_flip_layer db 'img_flip_layer',0 - aimg_rotate db 'img_rotate',0 - aimg_rotate_layer db 'img_rotate_layer',0 - aimg_draw db 'img_draw',0 +; aimg_destroy_layer db 'img_destroy_layer',0 +; aimg_count db 'img_count',0 +; aimg_lock_bits db 'img_lock_bits',0 +; aimg_unlock_bits db 'img_unlock_bits',0 +; aimg_flip db 'img_flip',0 +; aimg_flip_layer db 'img_flip_layer',0 +; aimg_rotate db 'img_rotate',0 +; aimg_rotate_layer db 'img_rotate_layer',0 +; aimg_draw db 'img_draw',0 +; aimg_convert db 'img_convert',0 ;-------------------------------------------------- system_dir_0 db '/sys/lib/' @@ -515,8 +522,7 @@ l_libs_end: align 4 i_end: - ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext - ;sizeof.TinyGLContext = 28 + ctx1 rb 28 ;sizeof.TinyGLContext = 28 dr_figure dd 0 qObj dd 0 TexObj dd 0 ;массив указателей на текстуры (в данном случае 1 шт.) diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/textures2.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/textures2.asm index c5e26e56f6..a9ef6c512d 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/textures2.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/textures2.asm @@ -1,5 +1,5 @@ use32 - org 0x0 + org 0 db 'MENUET01' dd 1,start,i_end,mem,stacktop,0,cur_dir_path @@ -8,16 +8,21 @@ include '../../../../../macros.inc' include '../../../../../KOSfuncs.inc' include '../../../../../load_img.inc' include '../opengl_const.inc' +include '../zbuffer.inc' include '../../../../../develop/info3ds/info_fun_float.inc' @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load +;Макрос для параметров типа double (8 байт) +macro glpush GLDoubleVar { + push dword[GLDoubleVar+4] + push dword[GLDoubleVar] +} + align 4 image_data_toolbar dd 0 IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3 -offs_zbuf_pbuf equ 24 ;const. from 'zbuffer.inc' - align 4 start: load_libraries l_libs_start,l_libs_end @@ -38,7 +43,7 @@ load_libraries l_libs_start,l_libs_end stdcall [kosglMakeCurrent], 5,30,[buf_ogl.w],[buf_ogl.h],ctx1 stdcall [glEnable], GL_DEPTH_TEST stdcall [glEnable], GL_NORMALIZE ;делам нормали одинаковой величины во избежание артефактов - stdcall [gluNewQuadric] + call [gluNewQuadric] mov [qObj],eax stdcall [gluQuadricDrawStyle], eax,GLU_FILL stdcall [gluQuadricTexture], eax,GL_TRUE @@ -48,7 +53,7 @@ load_libraries l_libs_start,l_libs_end mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext mov eax,[eax] ;eax -> ZBuffer - mov eax,[eax+offs_zbuf_pbuf] ;eax -> ZBuffer.pbuf + mov eax,[eax+ZBuffer.pbuf] mov dword[buf_ogl],eax load_image_file 'font8x9.bmp', image_data_toolbar, buf_1.w,buf_1.h @@ -109,7 +114,7 @@ draw_window: add ebx,IMAGE_TOOLBAR_ICON_SIZE mcall ,,,(35 shl 16)+5 ;масштаб - - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] mcall SF_REDRAW,SSF_END_DRAW popad ret @@ -143,7 +148,7 @@ key: mov byte[txt_angle_y.v],0 stdcall str_cat, txt_angle_y.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] @@: cmp ah,179 ;Right jne @f @@ -157,7 +162,7 @@ key: mov byte[txt_angle_y.v],0 stdcall str_cat, txt_angle_y.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] @@: cmp ah,178 ;Up jne @f @@ -171,7 +176,7 @@ key: mov byte[txt_angle_x.v],0 stdcall str_cat, txt_angle_x.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] @@: cmp ah,177 ;Down jne @f @@ -185,7 +190,7 @@ key: mov byte[txt_angle_x.v],0 stdcall str_cat, txt_angle_x.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] @@: jmp still @@ -230,7 +235,7 @@ but_zoom_p: mov byte[txt_scale.v],0 stdcall str_cat, txt_scale.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] ret align 4 @@ -253,21 +258,17 @@ but_zoom_m: mov byte[txt_scale.v],0 stdcall str_cat, txt_scale.v,Data_String call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] ret - align 4 caption db 'Test textures, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0 -align 4 -ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext -;sizeof.TinyGLContext = 28 align 4 draw_3d: stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины -stdcall [glPushMatrix] +call [glPushMatrix] stdcall [glScalef], [scale], [scale], [scale] stdcall [glScalef], 1.0, 1.0, 0.1 ;прижимаем сферу, что-бы сразу не вылазила при увеличении stdcall [glRotatef], [angle_y],0.0,1.0,0.0 @@ -275,19 +276,13 @@ stdcall [glPushMatrix] ; рисование панорамы stdcall [gluSphere], [qObj], 1.0, 64,64 -stdcall [glPopMatrix] +call [glPopMatrix] stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_scale,5,5,0xffff00 stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_angle_y,5,15,0xffff00 stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_angle_x,5,25,0xffff00 ret -qObj dd 0 -TexObj dd 0 ;массив указателей на текстуры (в данном случае 1 шт.) -texture dd 0 ;указатель на память с текстурой -text_w dd 0 -text_h dd 0 - scale dd 1.5 ;начальный масштаб sc_delt dd 0.05 ;изменение масштаба при нажатии sc_min dd 0.95 ;минимальный масштаб @@ -370,49 +365,51 @@ import_buf2d: align 4 import_libimg: dd alib_init1 - img_is_img dd aimg_is_img - img_info dd aimg_info - img_from_file dd aimg_from_file - img_to_file dd aimg_to_file - img_from_rgb dd aimg_from_rgb - img_to_rgb dd aimg_to_rgb +; img_is_img dd aimg_is_img +; img_info dd aimg_info +; img_from_file dd aimg_from_file +; img_to_file dd aimg_to_file +; img_from_rgb dd aimg_from_rgb +; img_to_rgb dd aimg_to_rgb img_to_rgb2 dd aimg_to_rgb2 img_decode dd aimg_decode - img_encode dd aimg_encode - img_create dd aimg_create +; img_encode dd aimg_encode +; img_create dd aimg_create img_destroy dd aimg_destroy - img_destroy_layer dd aimg_destroy_layer - img_count dd aimg_count - img_lock_bits dd aimg_lock_bits - img_unlock_bits dd aimg_unlock_bits - img_flip dd aimg_flip - img_flip_layer dd aimg_flip_layer - img_rotate dd aimg_rotate - img_rotate_layer dd aimg_rotate_layer - img_draw dd aimg_draw +; img_destroy_layer dd aimg_destroy_layer +; img_count dd aimg_count +; img_lock_bits dd aimg_lock_bits +; img_unlock_bits dd aimg_unlock_bits +; img_flip dd aimg_flip +; img_flip_layer dd aimg_flip_layer +; img_rotate dd aimg_rotate +; img_rotate_layer dd aimg_rotate_layer +; img_draw dd aimg_draw +; img_convert dd aimg_convert dd 0,0 alib_init1 db 'lib_init',0 - aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение - aimg_info db 'img_info',0 - aimg_from_file db 'img_from_file',0 - aimg_to_file db 'img_to_file',0 - aimg_from_rgb db 'img_from_rgb',0 - aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB +; aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение +; aimg_info db 'img_info',0 +; aimg_from_file db 'img_from_file',0 +; aimg_to_file db 'img_to_file',0 +; aimg_from_rgb db 'img_from_rgb',0 +; aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB aimg_to_rgb2 db 'img_to_rgb2',0 aimg_decode db 'img_decode',0 ;автоматически определяет формат графических данных - aimg_encode db 'img_encode',0 - aimg_create db 'img_create',0 +; aimg_encode db 'img_encode',0 +; aimg_create db 'img_create',0 aimg_destroy db 'img_destroy',0 - aimg_destroy_layer db 'img_destroy_layer',0 - aimg_count db 'img_count',0 - aimg_lock_bits db 'img_lock_bits',0 - aimg_unlock_bits db 'img_unlock_bits',0 - aimg_flip db 'img_flip',0 - aimg_flip_layer db 'img_flip_layer',0 - aimg_rotate db 'img_rotate',0 - aimg_rotate_layer db 'img_rotate_layer',0 - aimg_draw db 'img_draw',0 +; aimg_destroy_layer db 'img_destroy_layer',0 +; aimg_count db 'img_count',0 +; aimg_lock_bits db 'img_lock_bits',0 +; aimg_unlock_bits db 'img_unlock_bits',0 +; aimg_flip db 'img_flip',0 +; aimg_flip_layer db 'img_flip_layer',0 +; aimg_rotate db 'img_rotate',0 +; aimg_rotate_layer db 'img_rotate_layer',0 +; aimg_draw db 'img_draw',0 +; aimg_convert db 'img_convert',0 ;-------------------------------------------------- system_dir_0 db '/sys/lib/' @@ -421,14 +418,14 @@ system_dir_1 db '/sys/lib/' lib_name_1 db 'buf2d.obj',0 system_dir_2 db '/sys/lib/' lib_name_2 db 'libimg.obj',0 -err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,0 -err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,0 -err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,0 +err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0 +err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,'" -tE',0 +err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,'" -tE',0 head_f_i: -head_f_l db 'System error',0 -err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,0 -err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,0 -err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,0 +head_f_l db '"System error',0 +err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0 +err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,'" -tE',0 +err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,'" -tE',0 ;-------------------------------------------------- txt_scale: @@ -482,6 +479,12 @@ l_libs_end: align 4 i_end: + ctx1 rb 28 ;sizeof.TinyGLContext = 28 + qObj dd 0 + TexObj dd 0 ;массив указателей на текстуры (в данном случае 1 шт.) + texture dd 0 ;указатель на память с текстурой + text_w dd 0 + text_h dd 0 run_file_70 FileInfoBlock sc system_colors align 16 diff --git a/programs/develop/libraries/TinyGL/asm_fork/zbuffer.inc b/programs/develop/libraries/TinyGL/asm_fork/zbuffer.inc index c815d28a05..dfba779498 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/zbuffer.inc +++ b/programs/develop/libraries/TinyGL/asm_fork/zbuffer.inc @@ -63,7 +63,6 @@ struct ZBuffer xsize dd ? ;int ysize dd ? ;int linesize dd ? ;int ;line size, in bytes - dd ? ;fix old error offset mode dd ? ;int zbuf dd ? ;*unsigned short diff --git a/programs/media/voxel_editor/utilites/vox_tgl.asm b/programs/media/voxel_editor/utilites/vox_tgl.asm index 764cd26882..7adab3fe9d 100644 --- a/programs/media/voxel_editor/utilites/vox_tgl.asm +++ b/programs/media/voxel_editor/utilites/vox_tgl.asm @@ -3,20 +3,21 @@ use32 db 'MENUET01' ;. ᯮ塞 䠩 ᥣ 8 dd 1, start, i_end, mem, stacktop, openfile_path, sys_path -include '../../../../programs/macros.inc' -include '../../../../programs/proc32.inc' -include '../../../../programs/KOSfuncs.inc' -include '../../../../programs/load_img.inc' -include '../../../../programs/develop/libraries/TinyGL/asm_fork/opengl_const.inc' +include '../../../macros.inc' +include '../../../proc32.inc' +include '../../../KOSfuncs.inc' +include '../../../load_img.inc' +include '../../../develop/libraries/TinyGL/asm_fork/opengl_const.inc' +include '../../../develop/libraries/TinyGL/asm_fork/zbuffer.inc' include 'vox_3d.inc' include '../trunk/str.inc' include 'lang.inc' @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load if lang eq ru -caption db 'ᬮ ᥫ 04.05.20',0 ; +caption db 'ᬮ ᥫ 11.11.20',0 ; else -caption db 'Voxel viewer 04.05.20',0 +caption db 'Voxel viewer 11.11.20',0 end if 3d_wnd_l equ 5 ; tinygl ᫥ @@ -28,8 +29,6 @@ IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3 IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*10 image_data_toolbar dd 0 -offs_zbuf_pbuf equ 24 - align 4 start: load_libraries l_libs_start,l_libs_end @@ -111,7 +110,7 @@ timer_funct: fsub dword[delt_size] fstp dword[angle_y] call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] popad jmp still @@ -130,37 +129,28 @@ pushad mcall SF_DEFINE_BUTTON,(5 shl 16)+20,(5 shl 16)+20,3,[sc.work_button] mov ebx,(30 shl 16)+20 - mov edx,4 - int 0x40 + mcall ,,,4 add ebx,25 shl 16 - mov edx,5 - int 0x40 + mcall ,,,5 add ebx,30 shl 16 - mov edx,6 - int 0x40 + mcall ,,,6 add ebx,25 shl 16 - mov edx,7 - int 0x40 + mcall ,,,7 add ebx,25 shl 16 - mov edx,8 - int 0x40 + mcall ,,,8 add ebx,25 shl 16 - mov edx,9 - int 0x40 + mcall ,,,9 add ebx,25 shl 16 - mov edx,10 - int 0x40 + mcall ,,,10 add ebx,25 shl 16 - mov edx,11 - int 0x40 + mcall ,,,11 add ebx,25 shl 16 - mov edx,12 - int 0x40 + mcall ,,,12 call draw_toolbar_i stdcall [buf2d_draw], buf_0 - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] mcall SF_REDRAW,SSF_END_DRAW popad @@ -241,34 +231,31 @@ key: fld dword[angle_x] fadd dword[delt_size] fstp dword[angle_x] - call draw_3d - stdcall [kosglSwapBuffers] + jmp .end0 @@: cmp ah,177 ;Down jne @f fld dword[angle_x] fsub dword[delt_size] fstp dword[angle_x] - call draw_3d - stdcall [kosglSwapBuffers] + jmp .end0 @@: cmp ah,176 ;Left jne @f fld dword[angle_y] fadd dword[delt_size] fstp dword[angle_y] - call draw_3d - stdcall [kosglSwapBuffers] + jmp .end0 @@: cmp ah,179 ;Right - jne @f + jne still ;@f fld dword[angle_y] fsub dword[delt_size] fstp dword[angle_y] + .end0: call draw_3d - stdcall [kosglSwapBuffers] - @@: - + call [kosglSwapBuffers] + ;@@: jmp still @@ -319,7 +306,7 @@ mouse: fstp dword[angle_y] call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] jmp .end_d .end_m: bt eax,16 @@ -562,7 +549,7 @@ align 4 draw_cadr: mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext mov eax,[eax] ;eax -> ZBuffer - mov eax,[eax+offs_zbuf_pbuf] ;eax -> ZBuffer.pbuf + mov eax,[eax+ZBuffer.pbuf] mov dword[buf_1],eax mov dword[buf_1.w],512 @@ -615,7 +602,7 @@ proc but_zoom_p uses eax inc dword[v_zoom] stdcall buf_vox_obj_create_3d,[open_file_data],[open_file_ogl],0,0,[v_zoom] call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] @@: ret endp @@ -627,7 +614,7 @@ proc but_zoom_m uses eax dec dword[v_zoom] stdcall buf_vox_obj_create_3d,[open_file_data],[open_file_ogl],0,0,[v_zoom] call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] @@: ret endp @@ -646,7 +633,7 @@ proc but_light uses eax ebx ecx edx .end_light: call draw_toolbar_i call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] ret endp @@ -655,7 +642,7 @@ proc but_4 uses eax ebx ecx edx xor word[opt_cube_box],1 call draw_toolbar_i call draw_3d - stdcall [kosglSwapBuffers] + call [kosglSwapBuffers] ret endp @@ -747,7 +734,7 @@ proc but_draw_cadr uses eax ebx ecx edx cmp word[opt_auto_rotate],0 jne @f call draw_3d - ;stdcall [kosglSwapBuffers] + ;call [kosglSwapBuffers] @@: ret endp @@ -772,7 +759,7 @@ draw_3d: stdcall [glRotatef], [angle_z],0.0,0.0,1.0 stdcall draw_voxels_3d,[open_file_ogl] - stdcall [glPopMatrix] + call [glPopMatrix] ret align 4 @@ -911,49 +898,51 @@ l_libs_end: align 4 import_libimg: dd alib_init1 - img_is_img dd aimg_is_img - img_info dd aimg_info - img_from_file dd aimg_from_file - img_to_file dd aimg_to_file - img_from_rgb dd aimg_from_rgb - img_to_rgb dd aimg_to_rgb +; img_is_img dd aimg_is_img +; img_info dd aimg_info +; img_from_file dd aimg_from_file +; img_to_file dd aimg_to_file +; img_from_rgb dd aimg_from_rgb +; img_to_rgb dd aimg_to_rgb img_to_rgb2 dd aimg_to_rgb2 img_decode dd aimg_decode - img_encode dd aimg_encode - img_create dd aimg_create +; img_encode dd aimg_encode +; img_create dd aimg_create img_destroy dd aimg_destroy - img_destroy_layer dd aimg_destroy_layer - img_count dd aimg_count - img_lock_bits dd aimg_lock_bits - img_unlock_bits dd aimg_unlock_bits - img_flip dd aimg_flip - img_flip_layer dd aimg_flip_layer - img_rotate dd aimg_rotate - img_rotate_layer dd aimg_rotate_layer - img_draw dd aimg_draw +; img_destroy_layer dd aimg_destroy_layer +; img_count dd aimg_count +; img_lock_bits dd aimg_lock_bits +; img_unlock_bits dd aimg_unlock_bits +; img_flip dd aimg_flip +; img_flip_layer dd aimg_flip_layer +; img_rotate dd aimg_rotate +; img_rotate_layer dd aimg_rotate_layer +; img_draw dd aimg_draw +; img_convert dd aimg_convert dd 0,0 alib_init1 db 'lib_init',0 - aimg_is_img db 'img_is_img',0 ;। , ⥪ ᤥ ࠦ - aimg_info db 'img_info',0 - aimg_from_file db 'img_from_file',0 - aimg_to_file db 'img_to_file',0 - aimg_from_rgb db 'img_from_rgb',0 - aimg_to_rgb db 'img_to_rgb',0 ;८ࠧ ࠦ RGB +; aimg_is_img db 'img_is_img',0 ;। , ⥪ ᤥ ࠦ +; aimg_info db 'img_info',0 +; aimg_from_file db 'img_from_file',0 +; aimg_to_file db 'img_to_file',0 +; aimg_from_rgb db 'img_from_rgb',0 +; aimg_to_rgb db 'img_to_rgb',0 ;८ࠧ ࠦ RGB aimg_to_rgb2 db 'img_to_rgb2',0 aimg_decode db 'img_decode',0 ;⮬᪨ । ଠ ᪨ - aimg_encode db 'img_encode',0 - aimg_create db 'img_create',0 +; aimg_encode db 'img_encode',0 +; aimg_create db 'img_create',0 aimg_destroy db 'img_destroy',0 - aimg_destroy_layer db 'img_destroy_layer',0 - aimg_count db 'img_count',0 - aimg_lock_bits db 'img_lock_bits',0 - aimg_unlock_bits db 'img_unlock_bits',0 - aimg_flip db 'img_flip',0 - aimg_flip_layer db 'img_flip_layer',0 - aimg_rotate db 'img_rotate',0 - aimg_rotate_layer db 'img_rotate_layer',0 - aimg_draw db 'img_draw',0 +; aimg_destroy_layer db 'img_destroy_layer',0 +; aimg_count db 'img_count',0 +; aimg_lock_bits db 'img_lock_bits',0 +; aimg_unlock_bits db 'img_unlock_bits',0 +; aimg_flip db 'img_flip',0 +; aimg_flip_layer db 'img_flip_layer',0 +; aimg_rotate db 'img_rotate',0 +; aimg_rotate_layer db 'img_rotate_layer',0 +; aimg_draw db 'img_draw',0 +; aimg_convert db 'img_convert',0 align 4 proclib_import: ;ᠭ ᯮ㥬 㭪権 @@ -1023,13 +1012,13 @@ macro E_LIB n { n dd sz_#n } -include '../../../../programs/develop/libraries/TinyGL/asm_fork/export.inc' +include '../../../develop/libraries/TinyGL/asm_fork/export.inc' dd 0,0 macro E_LIB n { sz_#n db `n,0 } -include '../../../../programs/develop/libraries/TinyGL/asm_fork/export.inc' +include '../../../develop/libraries/TinyGL/asm_fork/export.inc' last_time dd 0 @@ -1051,18 +1040,11 @@ buf_1: dd 0 ;㪠 .color: dd 0xffffff ;+16 color db 24 ;+20 bit in pixel -align 4 -ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext -;sizeof.TinyGLContext = 28 - scale dd 1.414213562 angle_x dd 0.0 angle_y dd 0.0 angle_z dd 0.0 delt_size dd 3.0 -mouse_drag dd 0 ;० 業 ६饭 -mouse_x dd 0 -mouse_y dd 0 angle_dxm dd 2.8444 ;~ 3d_wnd_w/180 - ਡ 㣫 業 饭 襩 angle_dym dd 2.8444 ;~ 3d_wnd_h/180 @@ -1082,6 +1064,10 @@ lmodel_ambient dd 0.3, 0.3, 0.3, 1.0 ; align 16 i_end: + ctx1 rb 28 ;sizeof.TinyGLContext = 28 + mouse_drag dd 0 ;० 業 ६饭 + mouse_x dd 0 + mouse_y dd 0 rb 4096 stacktop: sys_path rb 1024