template.c
Go to the documentation of this file.00001
00002
00003
00004 #include <stdlib.h>
00005 #include <stdio.h>
00006 #include <float.h>
00007 #include <math.h>
00008 #include <windows.h>
00009 #include "struct.h"
00010 #include "..\common\postprocess\ximage.h"
00011 #include "local.h"
00012
00013 #include "template.h"
00014
00015 #if __X__MIPS__
00016 BOOL WINAPI _CRT_INIT(HINSTANCE ,DWORD , LPVOID );
00017 #endif
00018
00019 static HINSTANCE hDLLinstance=NULL;
00020 static long version=1;
00021
00022
00023
00024 #include "utils.h"
00025 #include "paint.c"
00026
00027
00028
00029 #if __WATCOMC__
00030 int APIENTRY LibMain(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved){
00031 #elif __BC__
00032 BOOL WINAPI DllEntryPoint(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved){
00033 #else
00034 BOOL WINAPI DllMain(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved){
00035 #endif
00036 switch (dwReason) {
00037 case DLL_PROCESS_ATTACH:
00038 #if __X__MIPS__
00039 if(!_CRT_INIT(hDLL,dwReason,lpReserved))return(int)FALSE;
00040 #endif
00041 hDLLinstance = hDLL;
00042 break;
00043 case DLL_PROCESS_DETACH:
00044 #if __X__MIPS__
00045 if(!_CRT_INIT(hDLL,dwReason,lpReserved))return(int)FALSE;
00046 #endif
00047 break;
00048 }
00049 return (int)TRUE;
00050 }
00051
00052 #if __SC__
00053 #pragma startaddress(DllMain)
00054 #endif
00055
00056 long _RenderImageProcess(char *PrmList, XIMAGE *lpXimage){
00057 double mr;
00058 float *Zb;
00059
00060
00061 if(lpXimage->Morph && lpXimage->mParameters != NULL){
00062 mr=lpXimage->MorphRatio;
00063
00064
00065 }
00066 Zb=lpXimage->Zbuffer;
00067
00068
00069
00070
00071 return 1;
00072 }
00073
00074
00075
00076 long _RenderGLexternal(char *PrmList, XIMAGE *lpXimage){
00077
00078 return 1;
00079 }
00080
00081
00082
00083
00084
00085
00086 BOOL CALLBACK DlgProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam);
00087
00088 char * _SetExternalParameters(
00089 char *Op,
00090 HWND hWnd,
00091 long ruler,
00092 char *name,
00093 X__MEMORY_MANAGER *lpEVI
00094 ){
00095
00096 char buffer[256];
00097 if(Op != NULL){
00098
00099 }
00100
00101
00102
00103 if(DialogBox(hDLLinstance,MAKEINTRESOURCE(DLG_TEMPLATE),hWnd,
00104 (DLGPROC)DlgProc) == FALSE)return Op;
00105
00106 if(Op != NULL)CALL_FREE(Op);
00107
00108
00109
00110
00111 strcpy(buffer,"Text parameter contents");
00112
00113 if((Op=(char *)CALL_MALLOC(strlen(buffer)+1)) == NULL){
00114 MessageBox (GetFocus(),"External effect: Out of memory","Error",
00115 MB_OK|MB_TASKMODAL|MB_ICONSTOP);
00116 return NULL;
00117 }
00118
00119 strcpy(Op,buffer);
00120 return Op;
00121 }
00122
00123
00124
00125 BOOL CALLBACK DlgProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam){
00126 char str[32];
00127 switch( msg ) {
00128 case WM_INITDIALOG:
00129
00130 CentreDialogOnScreen(hwnd);
00131 return TRUE;
00132 case WM_PAINT:
00133 PaintBackground(hwnd);
00134 break;
00135 case WM_COMMAND:
00136 switch(LOWORD(wparam)){
00137 case IDCANCEL:
00138 EndDialog(hwnd,FALSE);
00139 return(TRUE);
00140 case IDOK:
00141
00142 EndDialog(hwnd,TRUE);
00143 return(TRUE);
00144 default:
00145 break;
00146 }
00147 break;
00148 default: break;
00149 }
00150 return FALSE;
00151 }
00152