Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you replace the drawing engine with SDL2? #2

Closed
yihua-wang opened this issue Dec 4, 2019 · 5 comments
Closed

Can you replace the drawing engine with SDL2? #2

yihua-wang opened this issue Dec 4, 2019 · 5 comments
Labels
stale This will not be worked on

Comments

@yihua-wang
Copy link

It's too difficult to use the WIN32 GUI.

@embeddedt
Copy link
Member

Unfortunately, probably not.

Win32 was deliberately chosen to make the setup process easier for new users. If you would like SDL, you could use the Visual Studio project instead.

You shouldn't need to interact with the Win32 APIs at all. What's too difficult?

@yihua-wang
Copy link
Author

Can you add the console window to the codeblocks project to support printf infomation?
and fix a bug where the codeblocks process could not be completely closed after clicking the GUI window close button.

@yihua-wang
Copy link
Author

I fixed the bug by modifying the code in the Windows drv.c file at line 192.
Change the while to if, it can kill processes completely.

/*******************************************************/
static void msg_handler(void *param)
{
(void)param;

MSG msg;
BOOL bRet;
if( (bRet = PeekMessage( &msg, NULL, 0, 0, TRUE )) != 0)
{
    if (bRet == -1)
    {
        return;
    }
    else
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
}
if(msg.message == WM_QUIT)
    lv_win_exit_flag = true;

}

embeddedt added a commit to lvgl/lv_drivers that referenced this issue Dec 4, 2019
@embeddedt
Copy link
Member

embeddedt commented Dec 4, 2019

I fixed the bug by modifying the code in the Windows drv.c file at line 192.

Thank you! I've applied the change here.

Can you add the console window to the codeblocks project to support printf infomation?

Again, I'd prefer not to make this the default setting for simplicity and aesthetics (having a console window open at the same time looks rather ugly for an example). However, you can add the console to your copy of the project.

You'll need to right-click on the LittlevGL project in the sidebar and open the settings/properties window (sorry, I don't recall the exact name). Then you can choose the Build targets tab. It should look like this (without the "New build target" dialog):

You can then change the "Type" option to Console application. Some people have reported online that you may also need to add -mwindows to the linker options, which you can find by clicking the "Build options" button.

@stale
Copy link

stale bot commented Dec 25, 2019

This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale This will not be worked on label Dec 25, 2019
@stale stale bot closed this as completed Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants