Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github_28344065
scrcpy
提交
71f50fb6
S
scrcpy
项目概览
github_28344065
/
scrcpy
与 Fork 源项目一致
从无法访问的项目Fork
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
scrcpy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
71f50fb6
编写于
3月 28, 2018
作者:
R
Romain Vimont
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into dev
上级
57eaf052
82efff34
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
8 deletion
+12
-8
app/src/inputmanager.c
app/src/inputmanager.c
+5
-4
app/src/screen.c
app/src/screen.c
+7
-4
未找到文件。
app/src/inputmanager.c
浏览文件 @
71f50fb6
...
...
@@ -247,10 +247,11 @@ void input_manager_process_mouse_button(struct input_manager *input_manager,
SDL_bool
outside_device_screen
=
event
->
x
<
0
||
event
->
x
>=
input_manager
->
screen
->
frame_size
.
width
||
event
->
y
<
0
||
event
->
y
>=
input_manager
->
screen
->
frame_size
.
height
;
if
(
outside_device_screen
)
{
screen_resize_to_fit
(
input_manager
->
screen
);
}
return
;
if
(
outside_device_screen
)
{
screen_resize_to_fit
(
input_manager
->
screen
);
return
;
}
// otherwise, send the click event to the device
}
};
struct
control_event
control_event
;
...
...
app/src/screen.c
浏览文件 @
71f50fb6
...
...
@@ -136,6 +136,11 @@ void screen_init(struct screen *screen) {
*
screen
=
(
struct
screen
)
SCREEN_INITIALIZER
;
}
static
inline
SDL_Texture
*
create_texture
(
SDL_Renderer
*
renderer
,
struct
size
frame_size
)
{
return
SDL_CreateTexture
(
renderer
,
SDL_PIXELFORMAT_YV12
,
SDL_TEXTUREACCESS_STREAMING
,
frame_size
.
width
,
frame_size
.
height
);
}
SDL_bool
screen_init_rendering
(
struct
screen
*
screen
,
const
char
*
device_name
,
struct
size
frame_size
)
{
screen
->
frame_size
=
frame_size
;
...
...
@@ -174,8 +179,7 @@ SDL_bool screen_init_rendering(struct screen *screen, const char *device_name, s
SDL_FreeSurface
(
icon
);
LOGI
(
"Initial texture: %"
PRIu16
"x%"
PRIu16
,
frame_size
.
width
,
frame_size
.
height
);
screen
->
texture
=
SDL_CreateTexture
(
screen
->
renderer
,
SDL_PIXELFORMAT_YV12
,
SDL_TEXTUREACCESS_STREAMING
,
frame_size
.
width
,
frame_size
.
height
);
screen
->
texture
=
create_texture
(
screen
->
renderer
,
frame_size
);
if
(
!
screen
->
texture
)
{
LOGC
(
"Could not create texture: %s"
,
SDL_GetError
());
screen_destroy
(
screen
);
...
...
@@ -224,8 +228,7 @@ static SDL_bool prepare_for_frame(struct screen *screen, struct size new_frame_s
LOGD
(
"New texture: %"
PRIu16
"x%"
PRIu16
,
screen
->
frame_size
.
width
,
screen
->
frame_size
.
height
);
screen
->
texture
=
SDL_CreateTexture
(
screen
->
renderer
,
SDL_PIXELFORMAT_YV12
,
SDL_TEXTUREACCESS_STREAMING
,
new_frame_size
.
width
,
new_frame_size
.
height
);
screen
->
texture
=
create_texture
(
screen
->
renderer
,
new_frame_size
);
if
(
!
screen
->
texture
)
{
LOGC
(
"Could not create texture: %s"
,
SDL_GetError
());
return
SDL_FALSE
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录