.. _program_listing_file_libtcod_console_init.h: Program Listing for File console_init.h ======================================= |exhale_lsh| :ref:`Return to documentation for file ` (``libtcod/console_init.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* BSD 3-Clause License * * Copyright © 2008-2025, Jice and the libtcod contributors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #pragma once #ifndef LIBTCOD_CONSOLE_INIT_H_ #define LIBTCOD_CONSOLE_INIT_H_ #include "config.h" #include "console.h" #include "console_types.h" #include "context.h" #include "error.h" #include "tileset.h" #ifdef __cplusplus extern "C" { #endif // __cplusplus struct SDL_Rect; struct SDL_Window; struct SDL_Renderer; #ifndef NO_SDL TCOD_DEPRECATED( "This way of initializing libtcod is deprecated. See the documentation for how to use TCOD_context_new.") TCOD_PUBLIC TCOD_NODISCARD TCOD_Error TCOD_console_init_root(int w, int h, const char* title, bool fullscreen, TCOD_renderer_t renderer); TCOD_DEPRECATED( "This way of initializing libtcod is deprecated. See the documentation for how to use TCOD_context_new.") TCOD_PUBLIC TCOD_NODISCARD TCOD_Error TCOD_console_init_root_(int w, int h, const char* title, bool fullscreen, TCOD_renderer_t renderer, bool vsync); TCOD_DEPRECATED("This function is not compatible with contexts. Use SDL_SetWindowTitle to change the window title.") TCOD_PUBLIC void TCOD_console_set_window_title(const char* title); TCOD_DEPRECATED( "This function is not compatible with contexts. Use SDL_SetWindowFullscreen to set the fullscreen state.") TCOD_PUBLIC void TCOD_console_set_fullscreen(bool fullscreen); TCOD_DEPRECATED("This function is not compatible with contexts. Use SDL_GetWindowFlags to check this.") TCOD_PUBLIC bool TCOD_console_is_fullscreen(void); TCOD_DEPRECATED("This function is not compatible with contexts. Use SDL_GetWindowFlags to check this.") TCOD_PUBLIC bool TCOD_console_has_mouse_focus(void); TCOD_DEPRECATED("This function is not compatible with contexts. Use SDL_GetWindowFlags to check this.") TCOD_PUBLIC bool TCOD_console_is_active(void); TCOD_DEPRECATED("This function is not compatible with contexts. Use SDL for events and check for SDL_QUIT.") TCOD_PUBLIC bool TCOD_console_is_window_closed(void); TCOD_DEPRECATED("This function is not compatible with contexts.") TCOD_PUBLIC struct SDL_Window* TCOD_sys_get_sdl_window(void); TCOD_DEPRECATED("This function is not compatible with contexts.") TCOD_PUBLIC struct SDL_Renderer* TCOD_sys_get_sdl_renderer(void); #endif // NO_SDL TCOD_DEPRECATED("This function is not compatible with contexts.") TCOD_PUBLIC int TCOD_sys_accumulate_console(const TCOD_Console* console); TCOD_DEPRECATED("This function is not compatible with contexts.") TCOD_PUBLIC int TCOD_sys_accumulate_console_(const TCOD_Console* console, const struct SDL_Rect* viewport); TCOD_PUBLIC TCOD_Context* TCOD_sys_get_internal_context(void); TCOD_PUBLIC TCOD_Console* TCOD_sys_get_internal_console(void); TCOD_PUBLIC void TCOD_quit(void); #ifdef __cplusplus } // extern "C" namespace tcod { namespace console { [[deprecated( "This way of initializing libtcod is deprecated. See the documentation for how to use " "tcod::new_context.")]] TCOD_PUBLIC void init_root(int w, int h, const std::string& title, bool fullscreen, TCOD_renderer_t renderer); [[deprecated( "This way of initializing libtcod is deprecated. See the documentation for how to use " "tcod::new_context.")]] TCOD_PUBLIC void init_root(int w, int h, const std::string& title, bool fullscreen, TCOD_renderer_t renderer, bool vsync); } // namespace console } // namespace tcod #endif // __cplusplus #endif // LIBTCOD_CONSOLE_INIT_H_