/************************************************************************ * cl_ctx_exit - free all resources associated with the context (ctx) ***********************************************************************/ int cl_ctx_exit(cl_context *ctx) { if (ctx == NULL) return CL_RET_NO_CONTEXT; cl_destroy_context(ctx); return CL_RET_OK; }
int main(int argc, char **argv) { QApplication app(argc, argv); QCoreApplication::setOrganizationName("poolc"); QCoreApplication::setOrganizationDomain("poolc.org"); QCoreApplication::setApplicationName("mmo"); int ret_code = 0; mmocl_context ctx; cl_initialize_params params; params.chat_output_handler = chat_output_handler; params.debug_line_output_handler = debug_line_output_handler; params.game_event_handler = game_event_handler; cl_initialize_context(&ctx, ¶ms); cl_bind_context(ctx); opengl_scene* scene = new opengl_scene(nullptr); graphics_view view(scene); view.setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate); view.setRenderHint(QPainter::Antialiasing); //view.setScene(new opengl_scene(&view)); view.resize(640, 480); view.show(); ret_code = app.exec(); view.setScene(nullptr); delete scene; cl_destroy_context(); return ret_code; }