timer.device: Use AROS_UFIx() macros
[AROS.git] / test / mesa / mesagetprocaddress.c
blobce30d68ed64a64275349073b3188082e56f3514c
1 #include <exec/types.h>
2 #include <intuition/intuition.h>
3 #include <intuition/intuitionbase.h>
4 #include <intuition/screens.h>
6 #include <proto/exec.h>
7 #include <proto/dos.h>
8 #include <proto/intuition.h>
11 #include <GL/arosmesa.h>
12 #include <GL/gl.h>
14 #include <stdio.h>
16 AROSMesaContext glcont=NULL;
18 #define RAND_COL 1.0
20 PFNGLUNIFORM4IPROC AROSglUniform4i = NULL;
22 void testextensions()
24 printf("Getting pointer to glUniform4i...\n");
25 AROSglUniform4i = AROSMesaGetProcAddress("glUniform4i");
27 if (AROSglUniform4i != NULL)
29 printf("Pointer to glUniform4i acquired\n");
30 printf("Calling glUniform4i via pointer\n");
31 AROSglUniform4i(0, 0, 0, 0, 0);
32 printf("glUniform4i called\n");
34 else
36 printf("Failed to get pointer to glUniform4i");
40 struct Window * win = NULL;
42 void initmesa()
44 struct TagItem attributes [ 14 ]; /* 14 should be more than enough :) */
45 int i = 0;
47 // default config. Always used...
48 attributes[i].ti_Tag = AMA_Window; attributes[i++].ti_Data = (IPTR)win;
49 attributes[i].ti_Tag = AMA_Left; attributes[i++].ti_Data = win->BorderLeft;
50 attributes[i].ti_Tag = AMA_Top; attributes[i++].ti_Data = win->BorderTop;
51 attributes[i].ti_Tag = AMA_Bottom; attributes[i++].ti_Data = win->BorderBottom;
52 attributes[i].ti_Tag = AMA_Right; attributes[i++].ti_Data = win->BorderRight;
54 // double buffer ?
55 attributes[i].ti_Tag = AMA_DoubleBuf; attributes[i++].ti_Data = GL_TRUE;
57 // RGB(A) Mode ?
58 attributes[i].ti_Tag = AMA_RGBMode; attributes[i++].ti_Data = GL_TRUE;
60 // done...
61 attributes[i].ti_Tag = TAG_DONE;
63 glcont = AROSMesaCreateContext(attributes);
64 AROSMesaMakeCurrent(glcont);
67 void deinitmesa()
69 AROSMesaDestroyContext(glcont);
75 ** Open a simple window using OpenWindowTagList()
77 int main(int argc, char **argv)
80 win = OpenWindowTags(0,
81 WA_Title, (IPTR)"MesaGetProcAddress",
82 WA_CloseGadget, TRUE,
83 WA_DragBar, TRUE,
84 WA_DepthGadget, TRUE,
85 WA_Left, 10,
86 WA_Top, 10,
87 WA_InnerWidth, 300,
88 WA_InnerHeight, 300,
89 WA_Activate, TRUE,
90 WA_RMBTrap, TRUE,
91 WA_SimpleRefresh, TRUE,
92 WA_NoCareRefresh, TRUE,
93 WA_IDCMP, IDCMP_CLOSEWINDOW,
94 TAG_DONE);
96 initmesa();
98 testextensions();
100 deinitmesa();
102 CloseWindow(win);
104 return 0;