11/*
2- * Copyright 2019-2022 Diligent Graphics LLC
2+ * Copyright 2019-2025 Diligent Graphics LLC
33 * Copyright 2015-2019 Egor Yusov
44 *
55 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -43,7 +43,7 @@ int main(int argc, char** argv)
4343 HLSL2GLSLConverterApp Converter;
4444
4545 {
46- auto ret = Converter.ParseCmdLine (argc, argv);
46+ int ret = Converter.ParseCmdLine (argc, argv);
4747 if (ret != 0 )
4848 return ret;
4949 }
@@ -53,7 +53,7 @@ int main(int argc, char** argv)
5353 RefCntAutoPtr<ISwapChain> pSwapChain;
5454
5555 Display* display = nullptr ;
56- Window win = 0 ;
56+ Window win = 0 ;
5757 if (Converter.NeedsCompileShader ())
5858 {
5959 display = XOpenDisplay (0 );
@@ -77,7 +77,8 @@ int main(int argc, char** argv)
7777 GLX_DEPTH_SIZE, 24 ,
7878
7979 // GLX_SAMPLE_BUFFERS, 1,
80- GLX_SAMPLES, 1 ,
80+ // GLX_SAMPLES, 1, // 0 Means no MSAA. 1 Requests any MSAA.
81+ // If MSAA is not supported, glXChooseFBConfig will fail.
8182 None
8283 };
8384 // clang-format on
@@ -112,7 +113,7 @@ int main(int argc, char** argv)
112113 }
113114
114115 {
115- auto SizeHints = XAllocSizeHints ();
116+ XSizeHints* SizeHints = XAllocSizeHints ();
116117 SizeHints->flags = PMinSize;
117118 SizeHints->min_width = 320 ;
118119 SizeHints->min_height = 240 ;
@@ -154,7 +155,7 @@ int main(int argc, char** argv)
154155 };
155156 // clang-format on
156157
157- GLXContext ctx = glXCreateContextAttribsARB (display, fbc[0 ], NULL , 1 , context_attribs);
158+ GLXContext ctx = glXCreateContextAttribsARB (display, fbc[0 ], NULL , 1 , context_attribs);
158159 if (!ctx)
159160 {
160161 LOG_ERROR_MESSAGE (" Failed to create GL context." );
@@ -163,21 +164,21 @@ int main(int argc, char** argv)
163164 XFree (fbc);
164165
165166 glXMakeCurrent (display, win, ctx);
166-
167- auto * pFactory = Converter.GetFactoryGL ();
168- EngineGLCreateInfo CreationAttribs;
169- SwapChainDesc SCDesc;
167+
168+ IEngineFactoryOpenGL * pFactory = Converter.GetFactoryGL ();
169+ EngineGLCreateInfo CreationAttribs;
170+ SwapChainDesc SCDesc;
170171 CreationAttribs.Window .WindowId = win;
171172 CreationAttribs.Window .pDisplay = display;
172173 pFactory->CreateDeviceAndSwapChainGL (
173174 CreationAttribs, &pDevice, &pContext, SCDesc, &pSwapChain);
174175 }
175176
176- auto ret = Converter.Convert (pDevice);
177+ int ret = Converter.Convert (pDevice);
177178
178179 if (display != nullptr )
179180 {
180- auto ctx = glXGetCurrentContext ();
181+ GLXContext ctx = glXGetCurrentContext ();
181182 glXMakeCurrent (display, None, NULL );
182183 glXDestroyContext (display, ctx);
183184 XDestroyWindow (display, win);
0 commit comments